catalog descp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 11:08 PM
Hi Team ,
We are having a use case like below
This is the catalog
In the Short description field auto update has to be show
Auto update the <Short Description> with the following:
"Lost/Stolen" <Device Type> "Reported By" <Requested For>
can any one please help me with the confriguration how to achieve this
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 11:42 PM
Hi @nameisnani ,
You can use onChange catalog client script as below:
Variable name in onChange will be 'Device Type' field
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var reqFor = g_form.getDisplayValue('requested_for');
var newvall = g_form.getDisplayValue('device_type'); //replace with the backend name of device type field
g_form.setValue('short_description', newvall + " Device Type " + ' '+ " Reported By " + reqFor);
}
Please Mark My Response as Correct/Helpful based on Impact
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 11:50 PM - edited 06-13-2024 11:53 PM
Hello @nameisnani ,
Create a catalog client script, you have two options either by using a OnChange Catalog Client Script or OnSubmit.
If you want to directly see it after selecting the device type use On Change catalog client script:
Make sure to change your "Variable Name" to Device Type , since that will be your trigger to auto populate the short description.
If this has been of any help, please mark as solution and give thumbs up.
Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 12:13 AM
It has to be show like this
Please provide me the updated script for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 12:19 AM
Hi @nameisnani ,
Try the below and check the output:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var reqFor = g_form.getDisplayValue('requested_for');
var newvall = g_form.getDisplayValue('device_type'); //replace with the backend name of device type field
g_form.setValue('short_description', "Lost/Stolen " +newvall +' '+ "Reported By " + reqFor);
}
Please provide the output of the above if it is not working as expected.
Please Mark My Response as Correct/Helpful based on Impact
Mark this as Helpful / Accept the Solution if this helps.