Skip to Content
0
Former Member
Oct 11, 2011 at 07:45 PM

FormCalc script not working

319 Views

Hello Experts,

In Adobe Form, I have to hide a table column based on Output type (same form will be attached to 2 output types, 1 with hidden column and 1 with displayed column). I am passing Output type as parameter to form.

If I write the following formCalc script in P_IT_MSEG initialize, it hides Amount column ( both header and item)

data.FORM_DATA.P_IT_MSEG.overflowLeader.AMOUNT.presence = "hidden"

data.FORM_DATA.P_IT_MSEG.DATA[*].AMOUNT.presence = "hidden"

But if I write an if condition in formCalc in table initialization, the script is not getting executed at all (both VOLUM and AMOUNT column are visible in Adobe form).

var temp = data.FORM_DATA_HDR1.ADDR.rawValue

if( temp = "ZWAY" ) then

data.FORM_DATA.P_IT_MSEG.overflowLeader.AMOUNT.presence = "hidden"

data.FORM_DATA.P_IT_MSEG.DATA[*].AMOUNT.presence = "hidden"

else

data.FORM_DATA.P_IT_MSEG.overflowLeader.VOLUM.presence = "hidden"

data.FORM_DATA.P_IT_MSEG.DATA[*].VOLUM.presence = "hidden"

endif

I am binding the output type parameter to ADDR field in FORM_DATA_HDR1 form, so when my form is displayed ADDR field is having ZWAY value.

Can you please correct the syntax. Also, am unable to debug as xfa.host.messageBox("Test") does not work.

Regards,

Ashish