Thursday, 10 December 2015

To check the mandatory fields in a table through X++ code

static void checkProperties(Args _args)
{
    DictTable       dictTable;
    DictField       dictField;
    int             i, cnt;
 
    dictTable = new DictTable(tableNum(CustTrans));
    cnt = dictTable.fieldCnt();
    for (i= 1; i<=cnt;i++)
    {
        dictField = new DictField(tableNum(CustTrans),dictTable.fieldCnt2Id(i));
        if (dictField.mandatory())
        {
            info (strFmt("Field %1 is mandatory.",dictField.label()));
        }
    }
   
}


3 comments:

  1. Online BA Analyst Course
    Develop strong analytical and documentation skills to excel as a Business Analyst. Learn requirement gathering, stakeholder management, and project analysis through live projects.

    ReplyDelete
  2. Boost your career with our comprehensive salesforce admin training
    designed to equip you with practical skills for managing Salesforce effectively. Learn to customize dashboards, automate workflows, and optimize CRM operations through hands-on exercises.

    ReplyDelete
  3. Enhance your career with comprehensive salesforce developer training
    designed to equip you with hands-on skills in Apex, Visualforce, and Lightning components. Gain industry-ready expertise and become a certified professional through our practical, instructor-led sessions.

    ReplyDelete