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

Jeff60
Kilo Expert

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 !

22 REPLIES 22

Sorry @Ammad Satti but I'm still confused.

I can't find a solution.

Can you help me ?

Ammad Satti
Kilo Guru

Hi Jeff

Are you submitting request from portal or UI 16 View. Above code will not work in portal but it should work on UI 16 if  you are passing sys_id of item correctly to guid.add(ItemSysID). 

Thanks

 

Hello @Ammad Satti,

Yes i have try both.

When i check the Session log, i have this error :

 Evaluator: com.glide.script.RhinoEcmaError: "g_request" is not defined. fb2d6b6a2a295d29a7b50838f993f413 : Line(1) column(0) ==> 1: var value1 = g_request.getParameter('IO:13a97e561b4fcd184c16a938bd4bcb91'); 2: guide.add("value1");

Still blocked..

This is values after i click next on Order guide :

{
    "display_value": "",
    "guide_implications": true,
    "lookup_label": "",
    "type": "reference",
    "mandatory": false,
    "visible_guide": true,
    "visible_standalone": true,
    "refTable": "sc_cat_item",
    "_cat_variable": true,
    "sys_id": "13a97e561b4fcd184c16a938bd4bcb91",
    "readonly": false,
    "read_only": false,
    "lookup_value": "",
    "variable_name": "IO:13a97e561b4fcd184c16a938bd4bcb91",
    "value": "e253dd815f230100a9ad2572f2b477f1",
    "_class_name": "ReferenceQuestion",
    "ed": {
        "reference": "sc_cat_item",
        "searchField": "name",
        "defaultOperator": "STARTSWITH",
        "qualifier": "active=true^EQ",
        "name": "og_dm_catalog_item_1"
    },
    "visible": true,
    "label": "Catalog Item",
    "sys_readonly": false,
    "displayValue": "10 Things",
    "unique": false,
    "name": "og_dm_catalog_item_1",
    "attributes": "ref_ac_columns,ref_ac_columns_search,ref_ac_order_by,ref_auto_completer",
    "readonlyClickthrough": true,
    "choice": 0,
    "_parent": "og_dm_vs_catalog_item_s_to_add",
    "stagedValue": "e253dd815f230100a9ad2572f2b477f1",
    "originalValue": "",
    "_visible": true,
    "_readonly": false,
    "_mandatory": false,
    "catalogFieldName": "IO:13a97e561b4fcd184c16a938bd4bcb91",
    "price": "0.0",
    "recurring_price": "0.0"
}

Hi 

Can you try hardcoding SysID of item in guide.add and see if its working.