- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 11:47 PM
can we fetch value using g_form.getValue("field") from read-only fields in the form
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 08:33 AM
Hello Sonia,
I have tried to replicate it by making the field read-only using client script and UI policy, and it works.
I created 2 fields on the incident table. Field 1 & Field 2.
You can run the below script in client script or UI policy both:
g_form.setReadOnly("u_field_1",true);
var f1 = g_form.getValue("u_field_1");
g_form.setValue("u_field_2",f1);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 09:05 AM
Hi @sonia55 ,
Yes, provided that field is visible/(hidden by ui policy should also be fine) and present on the form.
If the field is not on the form then it is not available for you to access from g_form.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 07:59 AM
@sonia55 yes you can fetch the value of read-only field value. Just wanted to check are you looking for any specific senario.
Please mark the suggestion as helpful, if you find it useful to you or others who want to refer to similar content.
Regards,
RJ

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 08:33 AM
Hello Sonia,
I have tried to replicate it by making the field read-only using client script and UI policy, and it works.
I created 2 fields on the incident table. Field 1 & Field 2.
You can run the below script in client script or UI policy both:
g_form.setReadOnly("u_field_1",true);
var f1 = g_form.getValue("u_field_1");
g_form.setValue("u_field_2",f1);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 09:05 AM
Hi @sonia55 ,
Yes, provided that field is visible/(hidden by ui policy should also be fine) and present on the form.
If the field is not on the form then it is not available for you to access from g_form.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.