web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Question about [] in X++

(0) ShareShare
ReportReport
Posted on by

I started learning AX today, and I saw an example:

[
DataContractAttribute,
SysOperationContractProcessingAttribute(
classStr(HW_Apgiam_UI),
SysOperationDataContractProcessingMode::
CreateUIBuilderForRootContractOnly)
]

class HW_Apgiam_CT implements SysOperationInitializable
{
    Str1260   companycode;
   // StartDate fromDate;
    EndDate toDate;
    Str1260 mainAccountId;
    Str1260 vendAccount;
    CurrencyCode currency;
}


and 

[
    DataMemberAttribute("CompanyCode"),
    SysOperationLabelAttribute(literalstr("Company Code :"))
]
public Str1260 parmCompany(Str1260 _companycode = companycode)
{
    companycode = _companycode;

    return companycode;
}

Can anyone tell me the code inside "[]" can do, I can not find out the answer on the internet.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,108 Most Valuable Professional on at

    The things inside [ ] are "attributes".

    They're used to add additional information to classes and methods. In your example, attributes say that the class is a data contract (AX knows how to serialize data contract classes), that there is another class (HW_Apgiam_UI) that should be used for generating a dialog for this contract, which label should be used in the dialog for Company and so on.

    By the way, the value of SysOperationLabelAttribute is wrong. It should be a label ID, so there may be translations to other languages. It also shouldn't suffixed with " :".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans