Hi Folks,
Here is code sample to hide ENUM elements from a FORM at run time. For reference purpose I’m using SalesTable.BankducmentType (ENUM = BankDocumentType) field which contain below four elements
1. None
2. LetterOfCredit
3. ImportCollection
4. 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.
-Harry
Here is code sample to hide ENUM elements from a FORM at run time. For reference purpose I’m using SalesTable.BankducmentType (ENUM = BankDocumentType) field which contain below four elements
1. None
2. LetterOfCredit
3. ImportCollection
4. 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.
-Harry
Hai Deepak,
ReplyDeletethis code is useful for the above scenario only, if you hide first two values (None,Letter of credit) of the enum type means , this code will not work
after hide the first two values and then try to enter the value, you will be see the exact issue
ReplyDeleteHow can this be done using event handler? Please help
ReplyDelete