cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a context variable in formcalc

dstjacques
Participant
0 Kudos

I have a global variable in the context. That variable (type CHAR01) contains only "X" or space.

When the variable contains "X" one of the subform should hide.

The variable is not displayed in any subform.

Here is the Formcalc script I used without success at the subform initialize event.

if( HIDEFLAG eq "X") then

$.presence = "hidden"

endif

prabhjotsingh14
Active Participant
0 Kudos

First of all, drag the global variable HIDEFLAG in form context. This variable can be read directly in scripts without making it available in form layout. Trick is to use "value" property instead of "rawValue" as we want to access context variables.

If java script can be used, following code will work in INITIALIZE event of sub from:

var lv_data = xfa.resolveNode("$record.HIDEFLAG").value;
If( lv_data == "X") 
{
 this.presence = "hidden";
}

View Entire Topic

Hi Daniel,

Use below code.

If ( $record.variable == "X" ) then

condition...

Endif

Note - Variable name should be in capital letters