Record Producer Script is not working

Hari Babu
Mega Expert

Hi Folks,

I have written script for to auto populate Short description in  service request form with below data,

 

we have variable Type for request under that 3 dropdown  1.new desk phone 2.change desk phone 3.conferencing 

when new desk phone is select then auto populate in service request  form  short description  field  that droop down  values 

 

Script Written :-

It is not working properly  when i select any drop down  it is taking default "Conferencing-Desk Phone and Conferencing".

var abc = producer.type_of_request;
if(abc == 'new desk phone' || abc == 'change desk phone' || abc == 'conferencing')
{
current.short_description='New Desk Phone-Desk Phone and Conferencing';
current.short_description='Change Desk Phone-Desk Phone and Conferencing';
current.short_description='Conferencing-Desk Phone and Conferencing';

}

 

1 ACCEPTED SOLUTION

shanecarroll
Mega Expert

Your script is matching all the time and setting the last value

you should seperate into if else statements i.e something like this

 

if(abc == 'new desk phone'){
	current.short_description='New Desk Phone-Desk Phone and Conferencing';	
} else if( abc == 'change desk phone'){
	current.short_description='Change Desk Phone-Desk Phone and Conferencing';
}else {
	current.short_description='Conferencing-Desk Phone and Conferencing';
}

 

 

View solution in original post

11 REPLIES 11

manish64
Giga Guru

 

 

write on change script

 

function onChange(control, oldValue, newValue, isLoading) {

 

    if (isLoading || newValue == '') {

 

          return;

 

    }

 

 

 

g_form.clearValue('short_description');

 

  var choice = g_form.getValue('type_of_request');

 

 

 

if (choice == 'new desk phone' || choice == 'change desk phone' || choice == 'conferencing'') // value_2 is the value of the choice

 

{

 

  

 

  g_form.setValue('short_description','New Desk Phone-Desk Phone and Conferencing');

 

 

 

 

 

}

 

 

 

}

Please mark reply as Helpful/Correct, if Helpful. Thanks!

This Record Producers 

did you tried the logs...is it returning same values which you used for comaprison?

i don't know that ,because i am admin not much experia

ence on script 

 

Can you help me on that