- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:41 PM
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';
}
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:58 PM
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';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:50 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:50 PM
This Record Producers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:54 PM
did you tried the logs...is it returning same values which you used for comaprison?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:55 PM
i don't know that ,because i am admin not much experia
ence on script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2019 11:57 PM
Can you help me on that