Here we will see how to make a field alloEdit based on some condition in the ListPage form.
As we all now, every list page has the Interaction class, here we have a method selectionChanged() which is used to get the current record reference, it is similar to active method.
now Override the selectionChanged() method and write the below code to access data source property in ListPageInteraction class.
public void selectionChanged()
{
FormDataSource reqPO_ds;
ListPage listPage = this.listPage();
// This will get the recored
ReqPO reqPO = listPage.activeRecord(querydatasourcestr(ReqTransPOListPage,ReqPO)) as ReqPO;
// This will get the dataSource Object
reqPO_ds = listPage.activeRecord(queryDataSourceStr(ReqTransPOListPage,ReqPO)).dataSource();
super();
if (//Add condition)
{
allowEditFieldsOnFormDS_W(reqPO_ds, false);
reqPO_ds.object(fieldNum(ReqPO, TruckId)).allowEdit(true);
}
}
As we all now, every list page has the Interaction class, here we have a method selectionChanged() which is used to get the current record reference, it is similar to active method.
now Override the selectionChanged() method and write the below code to access data source property in ListPageInteraction class.
public void selectionChanged()
{
FormDataSource reqPO_ds;
ListPage listPage = this.listPage();
// This will get the recored
ReqPO reqPO = listPage.activeRecord(querydatasourcestr(ReqTransPOListPage,ReqPO)) as ReqPO;
// This will get the dataSource Object
reqPO_ds = listPage.activeRecord(queryDataSourceStr(ReqTransPOListPage,ReqPO)).dataSource();
super();
if (//Add condition)
{
allowEditFieldsOnFormDS_W(reqPO_ds, false);
reqPO_ds.object(fieldNum(ReqPO, TruckId)).allowEdit(true);
}
}
No comments:
Post a Comment