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