- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 02:55 AM
How to filter Service Offerings based on Services selected from Record Producer ( Service Portal)
Both Service and Service Offering variables are referencing to cmdb_ci_services tabel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 07:11 AM
Hi,
So it means the ref qualifier works with hard-coded value of service sysId
Since you want to filter records you need not use script include; this should ideally work
Is the variable name business_service correct?
javascript: 'parent=' + current.variables.business_service.toString();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 01:54 AM
Hi,
Is there any query business rule on cmdb_ci_service table which is restricting?
any table level READ ACL?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 02:02 AM
If there is issue with read ACL then Service field value shouldn't display the value from portal.. here I can see the list of Services from portal but not filtering the service offerings based on services selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 04:35 AM
can you try to hard-code the advanced ref qualifier to check if the filtering works?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 05:06 AM
How can I do that? any guide to follow? or any sample code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2022 05:21 AM
Have you tried using a combination of Client script and Script Include for your scenario:
1) Create a Client Callable Script Include and use the below script:
Make sure the Script Include and Function Name is same.
function getOfferings() {
var arr = [];
var getServiceSeelcted = this.getParameter('sysparm_service');
var gr = new GlideRecord('offering Table Name Here');
gr.addQuery('parent field name', getServiceSeelcted);
gr.query();
while (gr.next()) {
arr.push(gr.sys_id.toString());
}
return 'sys_idIN' + arr.toString();
}
Now update your Reference Qualifier in Service offering Variable as below:
javascript:'sys_idIN' + getOfferings(current.variables.VariablName);// Replace Variable Name with your Service Variable
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke