Showing results for 
Search instead for 
Did you mean: 

Sap Adobeform formcalc code

0 Kudos

I have two logos on the handle adobeform. I put these two logos in a subform for each of them. The first one is called Form1 and the second one is Form2. What I want to do is something I use in my codes.Depending on the values of the field in the structure (for example, GS_MEDIA-plant), if the plant value is equal to a variable such as Q1, Form2 will be visible and Form1 will be hidden. How can we write a FormCalc code to write this condition?

(e.g. ->>>> if ( $record.GS_MEDIA-plant == 'Q1' )

then $.presence = = "visible"


) this code is not working

Please, do you have some solution ?

Thank's in advance.



Active Contributor
0 Kudos

Try $record.GS_MEDIA-plant.rawValue

You could also statically disable one of the logos and then check the XML source for the form to see how it is written: you will still have to write the condition yourself but at least you can be sure about the target.

0 Kudos

data.#pageSet[0].Page1.Subform3.Form2::initialize - (FormCalc, client)

if ( $record.GS_MEDIA-plant.rawValue == 'Q2' )

then $.presence = "visible"


data.#pageSet[0].Page1.Subform3.Form1::initialize - (FormCalc, client)

if ( $record.GS_MEDIA-plant.rawValue == 'Q1' )

then $.presence = "hidden"


The codes I wrote like this, but unfortunately they don't work. How can I edit?

Active Contributor
0 Kudos

I'm not sure I understand the question: as long as you are in "change mode" you should be able to edit the events.

In one case, I had two subforms to alternate and I had to put the event at the subform above both of them.

Check that the value is really written as expected (in the data), try using a different event or place the code in a common node as I did.


First drag PLANT directly to context from interface. Now your variable can be directly read in script .

If form Q1 is not in master page then try the following code in form:ready event ( javascript in both server and client) else if it is in Master page then try at initialize event.

if ( $record.PLANT.value == "Q1")
{ this.presence = "visible" ; }
this.presence = "hidden";}
let me know if it works .

Accepted Solutions (0)

Answers (0)