- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 07:16 AM
Using the New Call Module as an example, is it possible to lock down a field as long as it is not new.
So on the New Call screen, we have a choice box called Call Type. Once the call record has been saved, or the user goes into the list of call records and drills into a saved call, I would like this field to be read only. I was thinking of setting the field to read only all the time and on new record setting read only to false. Is this possible?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 07:22 AM
Hi Jeremy,
Please check for "isNewRecord()" in the below link.
http://wiki.servicenow.com/index.php?title=GlideForm_%28g_form%29

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 07:22 AM
Hi Jeremy,
Please check for "isNewRecord()" in the below link.
http://wiki.servicenow.com/index.php?title=GlideForm_%28g_form%29

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 07:28 AM
Here you go.
if(!g_form.isNewRecord()){ //if record is saved then make the field mandatory
g_form.setMandatory('field_name', 'true');
}
Please mark the answer as correct if this answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2015 02:55 AM
Hi Pradeep,
Would this work for my incident state field.
I want to make the State read only on a new record, so that once its been submitted it can then be amended.
Would this script be correct?
- if(!g_form.isNewRecord()){ //if record is new state will be read only.
- g_form.setReadOnly('state');
- }
Would this be best applied as a Client Script?
Thanks,
Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2015 03:15 AM
Hi Graham,
Best Practice is to use UI Policy , Because too many client script on form increase loading of form. it can cause performance issue.
you can do this by Client script too
You can achieve this using UI Policy then create Ui policy actions like make state read only. you can use Conditions and script too.
pradeepksharma please correct me if I am wrong
Thanks & Regards
Govind Kumar Sharma