Technical help required for UI polices

Khalid9030
Tera Contributor

Hello Team, 

Need help for the below requirement. 

  1. We have a draft(check box) field this field is updating through Save button when user click on the save button the draft fields gets true.
  2. By using the submit button the draft field is updating to false and form gets re-direct to list view of the table.

 

Here our client requirement is when the user click on the save button form fields gets editable. And when the user click on the submit button all fields gets read only

For this I have created one UI police when the draft field gets false through submit button all fields are getting read only.it is working based on the

Draft field.

 

But our client is asking when we click on the new button to create a new record all fields should be editable. But now it is in read only as draft field false initially.

 

How we can achieve this requirement ? Please assist me. 

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron

Hi @Khalid9030 

 

Please follow the these.

As you have requirement to make the field editable when  user click on the save button form fields gets editable( draft(check box) field this field is updating through Save button) and when the user click on the submit button all fields gets read only

 

Create a UI policy that sets field edit ability based on conditions.

   If Draft is true, allow editing.

If Draft is false and the form is not in 'New' mode, make fields read-only.

If the form is in 'New' mode, allow editing regardless of the Draft field.

 

 

i create two Ui policy 

1. When draft is true make field editable ,but mark reverse if false

Bhavya11_0-1721120422249.png

 

2. Create Ui policy when draft is false and check in Condition script whether record is new or not then mark the read-only depending on that

Bhavya11_1-1721120506163.pngBhavya11_2-1721120516126.png

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

 

 

Thanks,
BK

 

View solution in original post

4 REPLIES 4

Bhavya11
Kilo Patron

Hi @Khalid9030 

 

Please follow the these.

As you have requirement to make the field editable when  user click on the save button form fields gets editable( draft(check box) field this field is updating through Save button) and when the user click on the submit button all fields gets read only

 

Create a UI policy that sets field edit ability based on conditions.

   If Draft is true, allow editing.

If Draft is false and the form is not in 'New' mode, make fields read-only.

If the form is in 'New' mode, allow editing regardless of the Draft field.

 

 

i create two Ui policy 

1. When draft is true make field editable ,but mark reverse if false

Bhavya11_0-1721120422249.png

 

2. Create Ui policy when draft is false and check in Condition script whether record is new or not then mark the read-only depending on that

Bhavya11_1-1721120506163.pngBhavya11_2-1721120516126.png

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

 

 

Thanks,
BK

 

@Bhavya11 

requirement is changed, please help me for the below. 
When we click the Submit button, the form redirects to the list view, and all fields should become read-only in both the list view and the form view. However, when the user clicks the Save button, all fields remain editable until the Submit button is pressed."

Slava Savitsky
Giga Sage

Is there any reason why you cannot set your Draft checkbox to true when you load the form of a new record? Then your UI Policy would work they way you want it to.

 

Another option is to use a State field that (unlike the checkbox which can only have two values: true/false) supports more options (e.g. new/draft/submitted). Then you would have greater control over your form and would also be able to add more states in the future if needed.

OlaN
Giga Sage
Giga Sage

Hi,

All through the platform the OOB UI action "Save" and "Submit" have the same function, Save to save changes and remain on the form, Submit saves the changes and take you to the previous place (form or list or whatever).

It feels a bit off that you with these requirements want to change this behaviour into something else.

Won't that cause confusion when using other parts of the platform?

 

I would recommend that you leave the UI actions out of this, and simply have a field on the form that allows for editing when checked/unchecked. Would be fairly simple to do with a UI policy.