As per our business requirement ,we have to set the value for the fields and disabled fields on the UI so that the user cannot edit these.We cannot use the disabled condition for each field as the fields to disable change based on scenario and some business rules .Assume we have 5 fields on the screen A,B,C,D,E .Below are few scenarios's.
Scenario1 - A,B,C Fields should be disabled
Scenario 2- A,C,D Fields should be disabled .
We have implemented this and disabled the fields using java script and on load of the screen we are calling the function .below is the code
Issue :- Apart from these fields , there are other fields on the UI which has some events configured like post value/refresh section .Whenever these events gets triggered the fields are re-enabled unless we call the function in the script file to disable .
Is there a way we can achieve our business use case without the need to call the script on each and every field on the UI .
***Updated by moderator: Lochan to update Categories***
Thanks Gurpreet for the reply.As i stated in my original post ,i do have all the code in a js function .Function gets called on load of the screen .I have a lof ot fields on the UI with server events which makes it a maintenace issue to go an configure the script for all those fields .
One thing i noticed is that ,when you disable a field using the disable condition in Pega ,the field stays disabled even though you have AJAX events configured on other fields.Is there a way i can acheive the same functionality of disabling using JS .
We have a lot of fields on the UI and if we go through the when condition route i have to create one when condition for each and every field on the UI .Also the field gets disabled on load of the screen using the custom java script function we have written .Only when the there is a refresh section or an AJAX call the fields are getting enabled .I tried using a when condition for disabling and it worked fine .
The script is indeed working as the fields are getting disabled on load .The real problem is that there are other fields on the screen which have ajax events configured like refresh section etc and the only option i have is to call this script function on every ajax call that is configured for each and every field .I cannot have a custom control as my ajax events differ from field to field.