How can I change the caption of an field in a scree by using onChange of another field or a selection list? I have tried following code but din't work.
if(this.value == 'value1'){
//alert('hahaha');
field_id.Caption = 'value2';
}
How can I change the caption of an field in a scree by using onChange of another field or a selection list? I have tried following code but din't work.
if(this.value == 'value1'){
//alert('hahaha');
field_id.Caption = 'value2';
}
You can use the client side API
if(this.value == 'value1'){
//alert('hahaha');
crm("oppo_description").caption("test");
}
what did you mean by "oppo_description"?
What should I put inside crm("")?
That is the name of the field that you wish to control.
It does not work. I have attached my code below.
field name(current) = Type
field id(current) = emp_type
field name(need to be changed) = Company
field id(need to be changed) = com_id
Code :
if(this.value == 'val1'){
crm("Company").caption("New_Caption");
}
please give your suggestions.
I made the assumption that you were working with a standard system screen e.g. Opportunity or Company.
Fields are referenced using their physical names including prefix e.g. comp_name or oppo_description
Have you tried playing with the code in the console to check that you can in fact reference the client side API in your screen?
Following code worked! Thank You!
crm.fields('<field_name>').caption('<new_caption>');
*Community Hub is the new name for Sage City