cancel
Showing results for 
Search instead for 
Did you mean: 

LiveCycle event scripting

Former Member
0 Kudos

Hi folks,

This doesn't seem to be a difficult thing to do. All I want to do is to present a section of a form (a non-interactive print form) depending on the value of a text element on the form.

I have a BWART field in one subform (which always prints). If the value of that field is '901', I want to show a second subform; if it's not '901', I want to hide the whole of the second subform.

I've tried the layout.ready event and the preprint event of the second subform. I have a feeling that I'm not referring to the BWART object properly. I've tried both JavaScript and FormCalc to no avail.

This HAS to be simple.....but I can't get it working ! Any clues - and any clues on how to debug the thing - are gratefully received (before I revert to SAPScript !@!!)

Guy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Figured it out myself ..thanks

Sandra_Rossi
Active Contributor
0 Kudos

Hi Guy, congratulations. I had "watched" your question because it interested me. Could you share how you made it work? Thx a lot for your help!

Former Member
0 Kudos

Hi Sandra,

I changed the way I did it a little, but the effect is the same.

My control field (BLOCK_B42) is an invisible field in the first subform (sf_ControlVars). This is always 'on' the form (but not visible, so it's a sort of temporary variable)

Then in the layout: ready event of the second subform, I have this in JavaScript....

if (data.sf_ControlVars.BLOCK_B42.rawValue == 'X'){

this.presence = "visible";

}

else{

this.presence = "hidden";

}

Works like a charm.

The key was - as I had thought - the way in which you must refer to the other objects on the form - the SOM syntax.

Hope that helps,

Guy

ps, If you have been able to dynamically modify the caption on a text field - do tell !!!!