Thursday, 5 October 2017

Color code for Grid in Listpage

I have  a requirement to Color code to Red for the Grid Column in Listpage. By comparing 2 dates in different datasources in ProdListpage.

Need to modify Interaction class of List Page .




private void createdispalyoption()
{
        FormBuild           formBuild = new FormBuild(formStr(ProdTableListPage), true);
        FormBuildDataSource fbds = formBuild.form().dataSource(1);
        TreeNode            treeNode;
        #AOT
        treeNode = TreeNode::findNode(#FormsPath + '\\ProdTableListPage\\Data Sources\\ProdTable\\Methods');
        formBuild.addMethod("displayOptions", "public void displayOption(ProdTable  _prodTable, FormRowDisplayOption _options){ ProdTableListPageSalesRelTmp    _prodTableListPageSalesRelTmp;select EarliestShipDateRequested from _prodTableListPageSalesRelTmp where _prodTableListPageSalesRelTmp.ProdId  ==  _prodTable.ProdId &&  _prodTableListPageSalesRelTmp.SessionId ==  sessionId(); if(_prodTable.DlvDate>_prodTableListPageSalesRelTmp.EarliestShipDateRequested && _prodTableListPageSalesRelTmp.EarliestShipDateRequested &&  _prodTable.DlvDate){ _options.backColor(8421631);_options.affectedElementsByControl(ProdTable_DlvDate.id());} super(_prodTable, _options);}", treeNode);
        formBuild.form().save();
}
Add below code to the below method
public void initializing()
{
    TreeNode            treeNode;
    #AOT
 treeNode = TreeNode::findNode(#FormsPath + '\\ProdTableListPage\\Data Sources\\ProdTable\\Methods\\displayOption');
    if(!treeNode)
    this.createdispalyoption();
}


Go to the field in Grid for which color should be applied. Make it Auto declaration  to Yes. In my case "ProdTable_DlvDate".

No comments:

Post a Comment