Display custom VIP icon on Catalog item variable set

Priyadharshini6
Tera Expert

Hi

I have a requirement to display a custom VIP icon at Catalog creation level for a variable set.

I did the following and its working fine for REQ form level.

- Image loaded to the db_image and then used a field style to display the icon whenever the VIP is true for List view of REQ records

- Wrote a on-change client script , so it takes care of displaying the icon whenever the requested for changes at the REQ form level

 

I am stuck at displaying the icon at catalog creation level, as i couldn't find options in field styles level to do it. Can anyone suggest, what are the other options.

 

Regards

Priya

1 ACCEPTED SOLUTION

Hi 

I am trying to set it at the platform level, when someone initiate the order of the catalog item. Alternatively i tried an onChange client script to display a fieldmsg and add decoration, both didn't work. Attaching the screenshot for reference

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if you are talking about portal then that client script won't work possibly because it uses DOM manipulation and DOM won't work on portal

Share the script you are using and the script screenshot

Regards
Ankur

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

Hi 

I am trying to set it at the platform level, when someone initiate the order of the catalog item. Alternatively i tried an onChange client script to display a fieldmsg and add decoration, both didn't work. Attaching the screenshot for reference

Its working! Just realised, i am not getting the Value to compare !

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    var caller = g_form.getReference('requested_for', highlightVIP);

    function highlightVIP(caller) {
        alert(caller.vip);
        if (caller.getValue('vip') == 'true') {
            alert("caller is a VIP");
           g_form.showFieldMsg('requested_for','VIP User','error');
        }
    
    else{
        
        alert("Caller is not a VIP");
    }
    }
    
}

 

This script works !

Glad to know.

Please close the thread by marking your own response as correct

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