Hide ENUM values at run time

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

image_thumb[5].png

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));   
}

image_thumb[7].png

Save your changes and, Now run your form and you will get desired values only.

转自:https://community.dynamics.com/365/financeandoperations/b/axaptavsme/posts/hide-enum-values-at-run-time-ax-2012

隐藏下拉框选项

    标签: X++

    Danzel
    Danzel管理员

    • 声明:本文由Danzel于2020-11-09转载(优化),转载须经原站同意并注明出处。
    • 本文地址:http://maryd.cn/?id=130
    上一篇:Dynamics ax 2012 Form Field allow edit based on conditons
    下一篇:dynamics ax number sequences

    留言评论

    暂无留言
    取消
    扫码支持