X++ code to disable menuitembutton when salesstatus is invoiced in salesTablelistPage using active method using chain of command (coc)
[ExtensionOf(formDataSourceStr(SalesTableListPage,SalesTable))]
final class BASDisablePO_Extension
{
public int active()
{
FormDataSource fds = this;
SalesTable salesTable;
int ret;
ret = next active();
salesTable = fds.formRun().dataSource(formDataSourceStr(SalesTable, SalesTable)).cursor();
FormControl purch=this.formRun().design().controlName(formControlStr(SalesTableListPage,Createpurchaseorders)) as FormControl;
if (SalesTable.SalesStatus==SalesStatus::Invoiced)
{
purch.enabled(false);
}
else
{
purch.enabled(true);
}
return ret;
}
}
Comments
Post a Comment