Hide repeating table row based on value?

matthewh7973307

06-08-2019

Hi,

I'm having difficulty with a scripting problem. I would like to hide any table row 'DATA_COND' where VTEXT within that row is equal to "Price".

This is the code I have created that does not work:

for (var a=0;a<data.BODY.ITEM_DETAIL.DATA_DETAIL.count;a++){

for (var b=0;b<data.BODY.ITEM_DETAIL.DATA_DETAIL[" + a + "].DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND.count;b++){

  if (xfa.resolvenode("data.BODY.ITEM_DETAIL[" + a + "].DATA_DETAIL.DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND[" + b + "].VTEXT").rawValue== "Price"){

   xfa.resolvenode(data.BODY.ITEM_DETAIL[" + a + "].DATA_DETAIL.DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND[" + b + "]).presence="hidden"; 

   }

  }

}

Where DATA_DETAIL repeats for each item and DATA_COND repeats for each item

Any pointers to where I might be going wrong?

Many Thanks!

Matt

1808071_pastedImage_0.png

Accepted Solutions (1)

Accepted Solutions (1)

Magus069

MVP

06-08-2019

Hi there,

there's some minor details you need to fix in your code, see the following:

Bold text is where I amended the code

instanceManager needs to be accessed to manage instances of the object itself.

It also can be accessed by using an underscore before the name of the object in question like the following:

I hope this will help

Let me know if you need clarifications..