on 12-23-2008 10:09 PM
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
Figured it out myself ..thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 !!!!
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.