Add field to request summary page- Client Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 02:30 PM
Hi everyone,
Can I please get some help with a client script that will change the value of the "short description" to the request_name variable on the portal? I attached a couple screenshots to display what I 'm trying to acheive. (Order guide has the variable request_name that I want to replace the short description on the order guide summary)
I've tried to edit the widget with no luck and was hoping to do this in a client script or script. I'm open to better ideas if anyone has any suggestions.
Thanks so much for any feedback you have!
I believe this should be set as the following:
on change type
sc_cat_item table
field name: short description
script I tried with no luck
function onLoad() {
var requestName = g_form.getValue('request_nameVariable');
if (requestName && g_form.getValue('short_description') == 'Test Catalog Item short description') {
g_form.setValue('short_description', requestName);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:45 AM
Thanks for the feedback, but no luck. Attached is the script for you to review, the alert is not commented out, and variable is removed. However, the alert does not appear and short description is not changed to request name. See attached screenshots should help explain. Please let me know if you have any suggestions.
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:56 AM
Hi Gemma4,
Based on you screenshot of the form, we have a mis-match on the short_description check ("Item" is not capitalized.) so try:
function onLoad() {
var requestName = g_form.getValue('request_name');
var shortDescription = g_form.getValue('short_description');
alert('requuestName = ' + requestName + ', short_description = ' + shortDescription +'.');
if (requestName && (shortDescription == 'Test Catalog item short description')) {
g_form.setValue('short_description', requestName);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 08:29 AM
Thanks, good catch! I corrected item and the alert now display after maintain items-catalog item is selected but no changes on the portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:58 AM
Hi @Bert_c1
Do you have any additional feedback on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 09:05 AM
HI @Gemma4,
I have no more feedback until I see your "onLoad" script logic. And verification that there is a field named 'request_name' defined on the "Order Guide" (sc_req_item seems to be the table in the above screenshot.)