UI Policy Conflicting with onLoad Client Script

Community Alums
Not applicable

Hello,

 

I have UI policy which says make 2 fields mandatory when HR = "";

AND

I have written a client script to hide certain fields for certain group members on an HR service. This is working fine if i deactivate the UI policy. 

Now, the problem if both are active it is creating conflict and I am still able to see those fields which I don't want for certain members. How do I resolve this issue?

Please see the attached screenshot. Any help would be highly appreciated. Thanks

 

find_real_file.png

 

find_real_file.png

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hello,

I mean, your UI policy is going to trigger if the form meets the condition of HR service is Advice and Council...regardless of the users group membership or not. So it seems in this case, since you're using BR scratchpad, you'll have to control all of this possibly from client script (onChange) so that you can add an additional if statement condition that the g_scratchpad.member is false AND HR is 'x' then show the fields and make one mandatory, etc.

Basically right now, all you're doing is...hey on form load, if you're member 'x' don't show these fields. Then later in the same story, you're going ok....now...if HR = 'x'...show the fields....

So those two pieces aren't talking to one another...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

1 REPLY 1

Allen Andreas
Administrator
Administrator

Hello,

I mean, your UI policy is going to trigger if the form meets the condition of HR service is Advice and Council...regardless of the users group membership or not. So it seems in this case, since you're using BR scratchpad, you'll have to control all of this possibly from client script (onChange) so that you can add an additional if statement condition that the g_scratchpad.member is false AND HR is 'x' then show the fields and make one mandatory, etc.

Basically right now, all you're doing is...hey on form load, if you're member 'x' don't show these fields. Then later in the same story, you're going ok....now...if HR = 'x'...show the fields....

So those two pieces aren't talking to one another...

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!