- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 01:33 AM
Hi All,
I have one requirement as below,
Based on my workflow stage i need to make all fields readonly in one shot. But it should not make readonly on sys_created_on,sys_created_by,sys_updated_on and sys_updated_ by.
I have used the below code. But its making all fields including sys fields. Because of which i am getting error" "
var fields = g_form.getEditableFields();
for (var x=0; x < fields.length; x++){
g_form.setReadOnly(fields[x],true);
}
i need code where except these fields("sys_created_on,sys_created_by,sys_updated_on and sys_updated_ by.") everything should be readonly in one shot.
If possible please help me?
Thanks,
Malaisamy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 01:43 AM
You mean something like this is not enough?
for (var x=0; x < fields.length; x++){
if (fields[x] != 'sys_created_on' && fields[x] != 'sys_created_by' && fields[x] != 'sys_updated_on' && fields[x] != 'sys_updated_by')
g_form.setReadOnly(fields[x],true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 01:43 AM
You mean something like this is not enough?
for (var x=0; x < fields.length; x++){
if (fields[x] != 'sys_created_on' && fields[x] != 'sys_created_by' && fields[x] != 'sys_updated_on' && fields[x] != 'sys_updated_by')
g_form.setReadOnly(fields[x],true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 02:15 AM
Hi Sergiu,
Thanks for the response . it works superb..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2018 04:50 PM
Hi can you please help I am new to SN i want to do the same where do i write this code and is this the full code, I am trying to make my form read only at the draft stage
I would greatly appreciate your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2018 11:05 AM
Hi Kiran,
Full code is here.
var fields = g_form.getEditableFields();
add your condition
for (var x=0; x < fields.length; x++){
if (fields[x] != 'sys_created_on' && fields[x] != 'sys_created_by' && fields[x] != 'sys_updated_on' && fields[x] != 'sys_updated_by' )
g_form.setReadOnly(fields[x],true);
}