- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2017 07:08 AM
Hi guys,
I have followed the workaround in the article in HI below...
I have then cloned the sp-variable-editor and embed it to the the Form cloned widget.
However the variables are still not displaying on the form.
Would you know what am I doing wrong?
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2017 03:18 AM
Hi guys I have debugged the server script, the reason the variables were not displaying is because I was viewing a record created from a record producer. I had to change the code to get the record producer sysid rather than the catalog item:
var gr = new GlideRecord(data.table);
if (gr.get(data.sys_id)) {
var recordClassName = gr.getRecordClassName();
console.log('recordClassNamee=' + recordClassName);
if (recordClassName != data.table) {
data.table = recordClassName
gr = new GlideRecord(data.table);
gr.get($sp.getParameter("sys_id"));
console.log('sysid=' + $sp.getParameter("sys_id"));
}
try {
//var catItem = data.table == "sc_task" ? gr.request_item.cat_item : gr.cat_item;
var catItem = gr.u_record_producer;
console.log('gr.cat_item=' + gr.cat_item);
// data.sc_cat_item = $sp.getCatalogItem(catItem);
//regina added params to the getCAtalogItem as these were introduced after Istanbul 3a+
//catItem = '13ffd3dddbd28b40f82ada94ce9619e3';
data.sc_cat_item = $sp.getCatalogItem(catItem,false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2017 08:33 AM
Hi Regina,
The KB article works for many versions, but after Istanbul patch 3, there is a change to the getCatalogItem class.
If you notice the comments section of the article, Vincent Hu suggests a change:
Posted by Vincent Hu (NOW) on 2017-10-03 07:43:57
The workaround provided works well for Istanbul before 3a.
In Istanbul 3a+ need to be modified as it is still using $sp.getCatalogItem(catItem). Should modify it to $sp.getCatalogItem(catItem,!!options.isOrdering, data.table);See KB0621849.
Does this help?
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2017 11:56 PM
Hi Michael thanks for the reply.
I am getting the below error when I added params to the getCatalogItem:
js_includes_sp.jsx:71268 Error loading the variable editor: InternalError: Can't find method com.glide.service_portal.widget.SPScriptable.getCatalogItem(java.lang.String,boolean,string). (<refname>; line 35)
If I remove the last param (data.table) this is what I'm getting:
js_includes_sp.jsx?v=05-05-2017_1035&lp=Mon_Nov_06_01_40_29_PST_2017&c=19_66:3390 The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2017 12:01 AM
I am using Build tag: glide-istanbul-09-23-2016__patch5-hotfix1-05-04-2017

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2017 12:21 AM
If you notice in sp_ui_formatter table. There is a formatter called "com_glideapp_servicecatalog_veditor".
You need to create a new formatter with this name as well in formatter table for which ever table you need and add that formatter in the form layout as well
Harish