Some times we need to enable or disable certain button based on certain criteria
class >> PurchTableListPageInteraction>>
method name >> public void selectionChanged()
declare
FormDataSource purchTable_ds;
super();
purchTable_ds = this.currentPurchTable().dataSource();
//PurchTable.DmsIsIntegrate == DmsIsIntegrate::None &&
if(PurchTable.PurchStatus != PurchStatus::Invoiced || PurchTable.PurchStatus != PurchStatus::Backorder)
{
this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),true);
if(PurchTable.InterCompanySalesId != "")
{
purchTable_ds.allowDelete(false);
}
else
{
purchTable_ds.allowDelete(true);
}
purchTable_ds.allowEdit(true);
}
else
{
this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),false);
purchTable_ds.allowDelete(false);
purchTable_ds.allowEdit(false);
}
class >> PurchTableListPageInteraction>>
method name >> public void selectionChanged()
declare
FormDataSource purchTable_ds;
super();
purchTable_ds = this.currentPurchTable().dataSource();
//PurchTable.DmsIsIntegrate == DmsIsIntegrate::None &&
if(PurchTable.PurchStatus != PurchStatus::Invoiced || PurchTable.PurchStatus != PurchStatus::Backorder)
{
this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),true);
if(PurchTable.InterCompanySalesId != "")
{
purchTable_ds.allowDelete(false);
}
else
{
purchTable_ds.allowDelete(true);
}
purchTable_ds.allowEdit(true);
}
else
{
this.listPage().actionPaneControlEnabled(formControlStr(PurchTableListPage,EditButton),false);
purchTable_ds.allowDelete(false);
purchTable_ds.allowEdit(false);
}
No comments:
Post a Comment