- 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: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-11-2019 12:11 AM
Thanks for your quick response,
Is is working as per my requirement.