- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2018 04:26 PM
I have an Order Guide with a Rule Base that's forwarding 3 different variable values to a Catalog Item. I've written an onLoad Catalog Client Script in one of the Catalog Items with the intent of concatenating the value in each of those Catalog Item variables into a variable called purchase_title. However, as you can probably expect, the variable I'm attempting to write to with the Catalog Client Script doesn't get populated by the script. I've been stubbornly banging my head against this one for a few hours and its become obvious to me that I'm missing a vital piece to the puzzle. I've read a few articles in the Community that suggest I'm on the right track, but I'm out of gas. Any assistance would be appreciated.
function onLoad() {
//Type appropriate comment here, and begin script below
var firstName = g_form_getValue('ob_pn_first_name');
var lastName = g_form_getValue('ob_pn_last_name');
var startDate = g_form_getValue('ob_pn_start_date');
if (firstName != ""){
var purTitle = ('Onboarding-New Computer Purchase: ' + firstName + ' ' + lastName + '-' + startDate);
// g_form_addInfoMessage('The Purchase Short Description has been auto-filled for this Onboarding PurchaseNow Request');
g_form.setValue('purchase_title',purTitle);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2018 06:59 PM
Hello Paul,
You haven't missed any piece of the puzzle, but made a very silly mistake. Instead of g_form.getValue(), you have used g_form_getValue().
Correct your mistake and you are good to go.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2018 10:41 PM
!! someones got a good eye for syntax !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 01:23 PM
Hey everyone. Thanks for the heads up on the systax... DOH!!! All working as expected now. Thanks again!!!
~Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 01:35 PM
Hello Paul,
It will be great if you could mark the correct answer to close the thread.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 01:39 PM
Eash, I'd be happy to give you credit for your help, but the UI, for some reason, is not providing the option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 01:40 PM
Nevermind. I was in the wrong UI. Done!