g_form.getvalue("field")

sonia55
Tera Expert

can we fetch value using g_form.getValue("field") from read-only fields in the form

2 ACCEPTED SOLUTIONS

SatyakiBose
Mega Sage

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);

View solution in original post

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

4 REPLIES 4

t_sadahisa
Giga Guru

Hi, @sonia55 

 

Yes, we can.

t_sadahisa_0-1675261304672.png

 

Rahul RJ
Giga Sage
Giga Sage

@sonia55 yes you can fetch the value of read-only field value. Just wanted to check are you looking for any specific senario. 

RahulJadhav_0-1675267159648.png

Please mark the suggestion as helpful, if you find it useful to you or others who want to refer to similar content.

Regards,

RJ

 

SatyakiBose
Mega Sage

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);

Basheer
Mega Sage

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 hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.