- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 05:22 PM
Hello All,
I have a record producer targetted to entity table, I have a control record referencing that entity. I was able to display the variable formatter on the entity table seamlessly using the same approach of creating a formatter and a macro and adding it to the form layout of the entity form as we do it in incident variable editor.
But i am not able to identify why its not working in the control table, if i wanted to add it, i had made necessary changes and here is my code
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:requires name="scripts/js_includes_catalog.js" includes="true"/>
<g:requires name="styles/${new CatalogCssSelector().getVariableCss()}" includes="true"/>
<g:if_polaris>
<g:then>
<g:requires name="styles/${new CatalogCssSelector().getPolarisVariableCss()}" includes="true"/>
</g:then>
</g:if_polaris>
<g2:evaluate var="jvar_catalog_item">
function eval_cat_item() {
var cat_item = "";
var catItemProducedGr = new GlideRecord("sc_item_produced_record");
catItemProducedGr.addQuery("record_key", current.getValue('profile'));
catItemProducedGr.query();
gs.info("test:"+catItemProducedGr.getRowCount(),"macrotest");
if (catItemProducedGr.next())
cat_item = catItemProducedGr.getValue("producer");
return cat_item;
}
eval_cat_item();
</g2:evaluate>
<g2:evaluate var="jvar_questionset_read_only" jelly="true">
(gs.getProperty('glide.sc.evaluate.variables.write.access', true) == 'true') ? !current.variables.canWrite() : !current.canWrite();
</g2:evaluate>
<div data-sn-macro-sys-id="${jvar_macro_sys_id}">
<g2:evaluate jelly="true"> var recordObject = new GlideRecord('sn_grc_profile');
recordObject.get(current.profile);
</g2:evaluate>
<j2:set var="ref" value="recordObject" />
<j:set var="jvar_producer_target_record" value="true"/>
<g2:client_script type="catalog_item" catalogItem="$[jvar_catalog_item]"/>
<g:inline template="catalog_ui_policy.xml"/>
<g2:render_component componentName="com.glideapp.servicecatalog.DefaultQuestionEditor"/>
</div>
</j:jelly>
Could some one let me know if there is an issue in this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 12:44 AM
Hey @Ankur Bawiskar Thanks for taking your time in assisting here. Got it fixed, after creating the Macro in global scope and formatter in the proper target scope with some existing community info as well from other question. The issue is closed now.
This article did help to some extent in bringing this to resolution if someone is looking for the same in future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 10:06 PM
Task is empty in the record producer produced records table, its only showing some value in the record key attribute @Ankur Bawiskar which i tried to query in the existing code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 10:17 PM
check if this helps
Variable editor on child task(other than catalog task)
I was able to achieve this when I created reference field on CHG which points to INC and INC was submitted via record producer
You should be able to achieve as well by small tweak
CHG Form
INC Form
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 12:44 AM
Hey @Ankur Bawiskar Thanks for taking your time in assisting here. Got it fixed, after creating the Macro in global scope and formatter in the proper target scope with some existing community info as well from other question. The issue is closed now.
This article did help to some extent in bringing this to resolution if someone is looking for the same in future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 12:45 AM
Glad to know.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 12:54 AM
Did you accidentally marked your own response as correct?
If my response helped please mark it correct as well so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader