Populate Item Variable using Catalog Client Script manipulating values brought over from Order Guide Rule Base.

Paul Porter
Tera Expert

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

        }

}

1 ACCEPTED SOLUTION

EashVerma
Giga Expert

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.


View solution in original post

9 REPLIES 9

!! someones got a good eye for syntax !!


Paul Porter
Tera Expert

Hey everyone.   Thanks for the heads up on the systax... DOH!!!   All working as expected now.   Thanks again!!!



~Paul


Hello Paul,



It will be great if you could mark the correct answer to close the thread.



Thanks.


Eash, I'd be happy to give you credit for your help, but the UI, for some reason, is not providing the option.


Nevermind.   I was in the wrong UI.   Done!