No items found.

Using reflections – Intrinsic functions

Imagine a simple scenario where you want to prompt the user with the name of the method in the table or name of the table itself (generally in practice you would rarely do that, but for the sake of simplicity lets say you do), you would probably do something like this

‍print "MyTableMethod";

What is wrong with this approach is that when for some reasons, you change the name of the table method you will have to remember to change it here as well, and believe me you will forget about that eventually. Here is not a big problem, the user will be just prompted with the wrong table method name, but what if another part of our program refers to this method and tries to call it using, for example, dictionary API like here

dictTable.callObject(“MyTableMethod”);‍

With this approach you will be doomed to suffer from run time errors, but fortunately there is a way to mitigate this by using so called intrinsic functions, like this

dictTable.callObject(tableMethodStr(MyTable, MyTableMethod)));

or

dictTable.callStatic(tableStaticMethodStr(MyTable, MyTableMethod)));

if it is a static method.

‍

When you do it like this you moved the issue from the run time to the compiler, so every time that you change table name or method name compiler will warn you that there is an error and it should be corrected.

You have corresponding intrinsic function for all elements in AOT, so you can reference them by name. All intrinsic functions beside identifierStr provide you with compile checking, however it is still better to use identifierStr than literals if for example none of the other intrinsic functions are available.

For more information about intrinsic functions please refer to the following link:

https://msdn.microsoft.com/en-us/library/aa626893.aspx

See more

AGA pomaga – poznaj inteligentnego asystenta do przetwarzania zapytań ofertowych: ANEGIS Generative Assistant

Read article
Text Link

Jak z pomocą narzędzi Power Platform, Microsoft Fabric i AI zrealizować plan na cyfrową transformację? ANEGIS Power Center

Read article
Text Link

Obowiązkowy KSeF startuje za 4 miesiące! Umów się na bezpłatne konsultacje i przygotuj swój system na zmiany

Read article
Text Link
Back to all

Looking for a Microsoft partner? Let's talk about your project

Work with a team that has delivered implementations and projects for dozens of companies. Schedule an introductory call and see:

How to tailor Dynamics 365 to your company's processes, rather than the other way around

Which areas are worth automating to save time and reduce costs

Here is the step-by-step implementation process with Anegis: from analysis to post-launch support

Select a meeting time
Dziękujemy za wiadomość!
Oops! Something went wrong while submitting the form.
Microsoft AI Builder
Microsoft Copilot Studio
No items found.
No items found.
No items found.