cancel
Showing results for 
Search instead for 
Did you mean: 

FORMCALC IF statement help

Former Member
0 Kudos

Hi,

I have been trying to get my basic IF statement to work using Formcalc. We are using Adobe Livecycle Designer 7.1 embedded in SAP HCM Processes and Forms. I have 2 fields that I am trying to hide/not hide based on MOLGA (country grouping).

On one of my form fields, here is the code in the initialization:

if ( $record.MOLGA.DATA[0].FIELD ne "10" ) then

this.presence = "invisible"

endif

So if the country grouping is not equal to the United States (10), make the field invisible. The text should be invisible. However, the employee I chose is United States (10) but the text does not show.

I am missing something obviously. The field (MOLGA) I am comparing is not the field I have the code in INITIALIZE. Perhaps that is the issue.

Regards,

JP

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jari,

Can you check that MOLGA field is having correct value in it.

I suppose your Structure is like this:

Body Page

---> MOLGA

---> PERNR

And you are writing this script on PERNR field, then first you have to goto Body Page and follow the hierarchy to access MOLGA field.

$record.parent.MOLGA.DATA[0].FIELD

Hope this helps.

With Regards,

Amit

Answers (1)

Answers (1)

former_member365727
Active Contributor
0 Kudos

Hi,

In the condition instead of ne write != :

if ( $record.MOLGA.DATA[0].FIELD != "10" ) then

this.presence = "invisible"

endif

Regards

Srikanth KV