This post is machine-translated. The original post in german language can be found here.

hasField()-Method

I had already seen the situation that I wanted to know if a record has a particular field to be able to process the containing value. For example, within a method, which processes the calling args().

For example, in class SysDictTable the hasMethod() method is available, but i have not found a hasField() method so far.

Therefore I've created the following logic:

Common callingRecord;
itemId itemId;
SysDictField itemDictField;

itemDictField = SysDictField::findFieldByName(tableId2name(callingRecord.TableId), identifierStr(itemId));

if(itemDictField)
{
    itemId = callingRecord.(itemDictField.id());
}

 

These post applies to following versions:
Dynamics AX 2012, Dynamics AX 2009

Add comment
 
 

 

 
 
 
Posts of the actual month
Mai 2024
MoTuWeThFrSaSu
 12345
6789101112
13141516171819
20212223242526
2728293031 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.