The CreatorCon Call for Content is officially open! Get started here.

Add field to request summary page- Client Script?

Gemma4
Mega Sage

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);
}
}variable2.PNGORDER GUIDE.png

11 REPLIES 11

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!

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);
	}
}

Thanks, good catch! I corrected item and the alert now display after maintain items-catalog item is selected but no changes on the portal. alert.png

Hi @Bert_c1 

Do you have any additional feedback on this? 

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.)