Grayed out field along with UI action when user click on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 12:09 PM
Hi
I have created a UI action Locked and when user click on it two field of form (start_date and end_date)should be grayed out and this UI action button Locked out should also get grayed out.
But I observed that when I reload the form then this button and required field again come into editable mode.
I am using below script :-
function set(){
g_form.setReadOnly('start_date', true);
g_form.setReadOnly('end_date', true);
document.getElementById("locked_out").disabled = true;
}
I want that user can click on Locked bbutton only once and then after it becomes grayed out and start date and end date also remains grayed out. Even after reload form.
Thanks,
Sourabh
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 12:22 PM
So add an onLoad script that works on a condition. For instance: if start_date and end_date are not empty, then all that you've written above.
function onLoad() {
//Type appropriate comment here, and begin script below
var start = g_form.getValue('start_date');
var end = g_form.getValue('end_date');
if(start !='' && end !='') {
g_form.setReadOnly('start_date', true);
g_form.setReadOnly('end_date', true);
document.getElementById("locked_out").disabled = true;
}
}
harel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 12:43 PM
I will create a check box called locked out on the table and hide it from the form layout,. Then in your Ui action you only set this check box to true. Now create a UI policy or client script to set the fields readonly and button when the checkbox value is true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 12:47 PM
Hi Abhinay,
I got your concept except check box. What do you mean by check box. Could you please give me an example.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 01:10 PM
How to set check box true inside UI action