on 07-06-2017 10:39 PM
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
Hi Daniel,
Use below code.
If ( $record.variable == "X" ) then
condition...
Endif
Note - Variable name should be in capital letters
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the benefits of all.
As Antoine suggested, the variable has to be part of the subform you are working in.
The "presence" property, found in the Object->Fleds tab, can be changed from visible to hidden.
So the variable will not be display but can be used by the Formcalc or Javascript.
Example:
Is a subform named "PAGE1", a TextField "langu" is bind to a global variable and is containing "EN"
In the subform PAGE1 you need to hide another subform name "French", you can put in the initialized event of the subform "French" the following javascript:
if (this.resolveNode("langu").rawValue == "EN") {
this.presence = "hidden";
}
else this.presence = "visible";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Antoine
Using "this.rawValue" indicate the variable is somewhere in the form layout.
In my case that variable is not used in the layout. It has been created only to allow the layout to react based on the value in it.
A global variable "HIDEFLAG TYPE CHAR01" has been created at the interface level.
The initialization of the variable has been done in the initialization code.
CLEAR hideflag.
IF <condition>.
hideflag = 'X'.
ENDIF.
The Global variable has been included in the context of the form.
That variable is not display anywhere in the form. It has been created only to use it to hide some subforms.
Regards
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
It depends where the variable is placed in the scheme.
If you don't mind JavaScript over FormCalc, here are some examples:
this.rawValue == 'X' or this.rawValue <> null
this.parent.rawValue == true
this.parent.parent.rawValue etc...
if (this.SW_PRINT_SUPPLEMENT.rawValue == null )
{ this.presence = "hidden";
}
Best,
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.