Variable set is hiding when submitting from Order guide

SS1510
Tera Contributor

I have an order guide, in which 2 catalog item are there.  one is pc purchase and other is new hire. When i submit from order guide then a variable set in pc purchase should be visible on ritm . When i submit pc purchase standalone then that variable set should not visible on ritm. It is working fine in platform view . But on service portal in ritm the variable set is not hiding.

For that i have applied client script on ritm

SS1510_0-1763715706764.png

Does anyone has any idea?

14 REPLIES 14

Ankur Bawiskar
Tera Patron
Tera Patron

@SS1510 

are you getting that value of order_guide variable?

what value you got on alert?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 
we get the sys_id of order guide. if order guide is present. this script is working on backend, but in portal it is not working

@SS1510 

it won't work in portal

-> your existing onLoad make it Run only on Requested Item and not on Catalog Item view so that it works only on native

-> create another onLoad and make it run on Catalog Item View and use this script so that it works only for portal

function onLoad() {
    //Type appropriate comment here, and begin script below

    var url = top.locatio.href;

    if (url.indexOf('sc_cat_item_guide') == -1) {

        g_form.setMandatory('updated_new_hire_variables', false);
        g_form.setMandatory('seattle_office_onboarding', false);

        g_form.setDisplay('updated_new_hire_variables', false);
        g_form.setDisplay('seattle_office_onboarding', false);
    }

}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar ,

In the order guide catalog item script i have to apply on