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

Zobacz inne

OneLake: czyli jak uporządkować odwieczny chaos w danych

Czytaj artykuł
Text Link

Ręczne przetwarzanie zamówień sprzedażowych to strata czasu. Jak to zautomatyzować?

Czytaj artykuł
Text Link

Najlepszy system ERP na 2026 rok? Microsoft Dynamics 365 w rankingach Gartner Magic Quadrant

Czytaj artykuł
Text Link
Wróć do wszystkich

Porozmawiajmy o Twoim projekcie

Napisz, z czym przychodzisz: wdrożenie, migracja, rozwój systemu albo pytanie, na które szukasz odpowiedzi. Wracamy z konkretną propozycją następnego kroku, nie z prezentacją handlową.

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.