gel("sys_uniqueValue").value not working inside UI Action

Ajit Natarajan1
Kilo Expert

I am trying to implement a UI action (form link) that shows in the Catalog Item form that lets developers preview the item inside Service Portal with following script. However, the gel() reference doesnt seem to work. I have an Orlando developer instance where this seems to work fine. Looking for some guidance.

function previewInPortal(){
    var catItem = gel("sys_uniqueValue").value;
    var url = '/sp?id=sc_cat_item&sys_id='+catItem; // replace dev Id with your instance id
    window.open(url,'_blank');    
}

1 ACCEPTED SOLUTION

Ajit Natarajan1
Kilo Expert

All suggestions are valid. The issue was resolved after I set the "isolate scripts" to false. I had to make that attribute visible by going into configure > form layout.

Got the hint from => https://community.servicenow.com/community?id=community_question&sys_id=be150ce2db766780656a5583ca961935

 

 

View solution in original post

5 REPLIES 5

Ajit Natarajan1
Kilo Expert

All suggestions are valid. The issue was resolved after I set the "isolate scripts" to false. I had to make that attribute visible by going into configure > form layout.

Got the hint from => https://community.servicenow.com/community?id=community_question&sys_id=be150ce2db766780656a5583ca961935