How to hide fields in the preview pane of "PurchTableListPagePreviewPane" by code?

Question Status

Verified
Kima asked a question on 7 Aug 2015 7:26 AM

Hi,

I need to hide some fields in preview pane “PurchTableListPagePreviewPane”, by modifying interaction class PurchTableListPageInteraction.

How can I get object “PurchTableListPagePreviewPane” in interaction class ?

 

Best Regard,.

Reply
Bhaskar Roy responded on 7 Aug 2015 7:53 AM

You want to hide the field permanently or condition based. if you want to hide the field permanently  please go to infoPart -PurchTableListPagePreviewPane and do it.  

Reply
Verified Answer
Kima responded on 7 Aug 2015 9:15 AM

I want to hide the field conditionally.

To do this, I added this code :

public void selectionChanged()

{

   PartList partList;

   Common   externalRecord;

   FormRun  formRun,factBox;

   FormDataSource frmDs;

   int partListCount;

   ;

   externalRecord = this.listPage().activeRecord(queryDataSourceStr(PurchTableListPage,   PurchaseTable));

   if(externalRecord.isFormDataSource())

   {

       frmDs   = externalRecord.dataSource();

       formRun = frmDs.formRun();

       if(formRun)

       {

           partList = new PartList(formRun);

           for (partListCount = 1; partListCount <= partList.partCount(); partListCount++)

           {

               factBox = partList.getPartById(partListCount);

               if(factBox &&  factBox.name() == identifierStr(PurchTableListPagePreviewPane))

               {

                   if //condition

                   {

                       factBox.design().controlName('ControlName').visible(false);

                   }

                   else

                   {

                        factBox.design().controlName('ControlName').visible(true);

                   }

               }

           }

       }

   }

}

Best Regard,

Reply
Verified Answer
Kima responded on 7 Aug 2015 9:15 AM

I want to hide the field conditionally.

To do this, I added this code :

public void selectionChanged()

{

   PartList partList;

   Common   externalRecord;

   FormRun  formRun,factBox;

   FormDataSource frmDs;

   int partListCount;

   ;

   externalRecord = this.listPage().activeRecord(queryDataSourceStr(PurchTableListPage,   PurchaseTable));

   if(externalRecord.isFormDataSource())

   {

       frmDs   = externalRecord.dataSource();

       formRun = frmDs.formRun();

       if(formRun)

       {

           partList = new PartList(formRun);

           for (partListCount = 1; partListCount <= partList.partCount(); partListCount++)

           {

               factBox = partList.getPartById(partListCount);

               if(factBox &&  factBox.name() == identifierStr(PurchTableListPagePreviewPane))

               {

                   if //condition

                   {

                       factBox.design().controlName('ControlName').visible(false);

                   }

                   else

                   {

                        factBox.design().controlName('ControlName').visible(true);

                   }

               }

           }

       }

   }

}

Best Regard,

Reply