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-14-2024 12:47 AM
Your script should work.
But this only works, if the user fills out the requested for field first.
A onSubmit script would be safer in this case. (Or two onChange scripts?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 12:34 AM
Try this one, you might want to change UI Type and check Isolate script:
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 12:50 AM
If the first one does not work because of the your reference field 'requested_for' you may try this :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var reportedBy = g_form.getDisplayBox('requested_for').value;
var device = g_form.getDisplayValue('device_type');
g_form.setValue('short_description', '"Lost/Stolen " '+ device + ' "Reported by " '+ reportedBy);
//Type appropriate comment here, and begin script below
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 12:28 AM
Hi @nameisnani ,
I tried your problem in my PDI and it works for me.
Please create onChange client script on any of variable either Device Type or Requestor.
Suppose you create on device type and add below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var requestor = g_form.getDisplayValue('requested_for');
var deviceType = g_form.getDisplayValue('device_type');
g_form.setValue('short_description', "Lost/Stolen " + deviceType + ' ' + "Reported By " + requestor);
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak