How to use a 'reference' field as an item selector in an Order Guide ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2022 09:31 AM
Hello everyone.
My question is about Script on an Order Guide.
I would like to use a variable (type: Reference) linked to the table "sc_cat_item" on the first step to add the item selected on the second step "Choose Options".
For example, as you can see on the screenshot, if i enter a catalog item on theses two variables, after i have click on NEXT, i can fill this two items on the step "Choose Options".
Thanks for your help !
- 1,550 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2022 12:24 PM
Hi
You can try below code
var value = g_request.getParameter('IO:sys_id');
guide.add(vaule);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 02:29 AM
Hello
I'm not sure to understand..
I have created a "Catalog client scripts" with this code :
function onSubmit() {
var value = g_request.getParameter('IO:84dabf301bd1689097ce31e5464bcbc2');
guide.add(value);
}
I took a sys_id of one of my catalog item for example.
And i have this error :
One other question, how can i get the sys_id of my order guide variable "Catalog Items" and put it on this script ?
Thanks for your help. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 04:23 AM
Hi Jeff
g_request will not work in client script, you can use it in order guide script. If script field is not available on form you can add using Form Layout.
g_request.getParameter('IO:SysID of varaiable') can get you value for order guide variable.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2022 02:36 AM
Hello
I indeed had to add the "script" part in the "Order Guide" form.
I then added the following script:
// Get the value of my variable reference type.
var value1 = g_request.getParameter('IO:13a97e561b4fcd184c16a938bd4bcb91');
// Add the catalog item filled on the variable reference type in the options.
guide.add(value1);
But unfortunately it doesn't work.
As a reminder, I have a reference type field linked to the "sc_cat_item" table which is filled in and which must then appear in the next step as an Item to fill in.
Thanks !