Monday, August 10, 2015

How to Hide Enumerations in Run-Time using X++

Hello,

If you are wondering how to hide enumeration options without having to meddle with security, here's how to do it:


For reference purpose I’m using SalesTable.BankdocumentType (ENUM = BankDocumentType) field which contain below four elements:

1. None2. LetterOfCredit3. ImportCollection4. LetterOfGuarantee


Now i want to show only first two values while selecting on SO, to achieve this override the form control method as below public void enter(){    super();    this.delete(enum2str(BankDocumentType::LetterOfGuarantee));    this.delete(enum2str(BankDocumentType::ImportCollection));    }Save your changes and, Now run your form and you will get desired values only.

That's it. Thanks for stopping by.

No comments:

Post a Comment