Wednesday, May 21, 2014

Resolving Ctrl+F5 Error on creation of Item Master while edit and update in Master data in AX2012:

Resolving Ctrl+F5  Error on creation of Item Master while edit and update in Master data in AX2012:

 FormRun         formRun;
    FormObjectSet   formObjSet;
    int             i;
    InventTable     linventTable;

    // refresh and reread inventTable datasource if exists in form
    if (this.isFormDataSource())
    {
        formRun = this.dataSource().formRun();
        for (i=1; i<= formRun.dataSourceCount(); i++)
        {
            if (formRun.dataSource(i).cursor() is InventTable)
            {
                formObjSet = formRun.dataSource(i);
                linventTable = formObjSet.cursor() as InventTable;
                break;
            }
        }
        if (!linventTable)
        {
            linventTable = InventTable::find(this.ItemId, true);
        }
        if (linventTable)
        {
            if (formObjSet)
            {
                formObjSet.refresh();
                formObjSet.reread();
            }
        }
    }

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...