cancel
Showing results for 
Search instead for 
Did you mean: 

Subform is getting hidden on click of check & Send HCM Processes

Former Member
0 Kudos

Hi,

I have checked the forum but did not find any requirement/solution close to mine.

Here is my requirement, I have been struggling with.

I have 3 subforms of the same type(contains 8 fields each) to add family members. Subform 1 is mandatory and always visible. Subform 2 and 3 are hidden when the form loads. I have a javascript on the initialize event to hide them.

this.resolveNode("subform name").presence = "hidden";

When the user decides to add more details, clicks on the ADD button which makes the subform 2 and 3 visible, one at a time. Script under the click event of add button is:

if (this.resolveNode("subform2").presence == "hidden"){

this.resolveNode("subform2").presence = "visible";

this.resolveNode("PRI_DES2.PRI_FLAG2").rawValue = "X";      "I am also adding a flag on a field on the ADD button.

}

On the subform2 form ready event: I have the below code to have the subform2 visible.

if ( $record.PRI_FLAG2 == "X" ) then

       $.presence = "visible"

endif

Everything works fine till this point.

When the user fills the data and clicks on check & Send, the subform2 disappears; Note that the values in the fields are still there, I can see it when I click on the ADD button. I am sure the initialize event is triggering again on check & send, taking the form to the initial stage.

I tried various ways to restrict it. I am not using instance manager, just making subforms hidden / visible. I have both FORMCALC and Javascript on the form.

Please help with any suggestions / ask me for more details.

Thanks so much - Rajesh

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

Define a form field in your HCM P&F config to hold the value for this (ie. it will be like a "state" variable for you). Have that field HIDDEN on your Adobe form. Then use the value of THAT in your script to show/hide the subforms. In that way, it will "carry over" come step to step. You are seeing correctly what happens...there is a postback and the form comes back again/reloads...which means your user selections/events are gone....unless you control/store the state yourself.

Hope this helps!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check why these 2 are different.

if (this.resolveNode("subform2").presence == "hidden"){

this.resolveNode("subform2").presence = "visible";

this.resolveNode("PRI_DES2.PRI_FLAG2").rawValue = "X";      "I am also adding a flag on a field on the ADD button.

}

On the subform2 form ready event: I have the below code to have the subform2 visible.

if ( $record.PRI_FLAG2 == "X" ) then

       $.presence = "visible"

endif

By the way, can you please add this to replace your hidden statement during initialize?

if ( $record.PRI_FLAG2 <> "X" ) then

this.resolveNode("subform name").presence = "hidden";

else

this.resolveNode("subform name").presence = "visible";

endif.

Thanks.

regards,

Xiang Li

Former Member
0 Kudos

Thanks Chris and Xiang Li.

Found similar issue in Adobe forums & resolved it using the flag. when I change the presence,  based on the flag, added the script in form ready. It worked. 

Thanks,

Raj