client script help needed

pramn
Tera Guru

Hey team, 

Need a client script for below conditions 

pramn_0-1690278139623.png

Then 

output would be 

pramn_1-1690278248268.png

currency -usd
country -US

also work not should be mandatory  

pramn_2-1690278394451.png

 

1 ACCEPTED SOLUTION

Hello @pramn 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

View solution in original post

9 REPLIES 9

var subcat = g_form.getValue('sub_category');
var request = g_form.getValue('request_type');

is the drop down value  ..so its giving me theerror

 

Hello @pramn 

 

What error are you getting can you pls share it.

 

 

Hello @pramn 

 

in that case use g_form.getDisplayValue('sub_category');

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Harish KM
Kilo Patron
Kilo Patron

Hi you can write a onchange client script on field Request Type

sample script:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var getSubCat = g_form.getValue('subcategory');
var getReqType = g_form.getValue('request_type');

if (getSubCat == 'your choice value' && getReqType == 'your choice value' )
{
g_form.setValue('currency','USD'); // field name, value
g_form.setValue('country','US');
g_form.setMandatory('work_notes',false);
}
else
{
g_form.setMandatory('work_notes',true);
}

}

Regards
Harish

var subcat = g_form.getValue('sub_category');
var request = g_form.getValue('request_type');

is the drop down value  ..so its giving me the error