Choice value is not visible to customer but admin can see
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2024 04:27 AM
Hi,
I have added Business line (choice field )field in the Product model table. and same added in the Sold product table.
I have written a script include to show the Business line values in the catalog form based on account.
Script include
getBusinessLinePortal: function() {
var bl = [];
var account = this.getParameter("sysparm_account");
gs.log("Account " + account);
var dee = new GlideRecord("sn_install_base_sold_product");
dee.addEncodedQuery('account=' + account);
dee.query();
while (dee.next()) {
bl.push(dee.product.u_business_line_product.toString());
}
gs.log("Business Line " + bl);
return bl.join(',');
},
Client script
function onLoad() {
var account = g_form.getValue("csm_account");
var script_include = new GlideAjax('global.getProductPortal');
script_include.addParam('sysparm_name', 'getBusinessLinePortal');
script_include.addParam('sysparm_account', account);
script_include.getXML(showDetails);
function showDetails(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var array = answer.split(',');
alert("Array " + array);
for (var i = 0; i < array.length; i++) {
g_form.addOption('u_business_line', array[i], array[i]);
}
}
}
Business line options are- Med, Max, Data
When I am impersonating with customer whose account is associated with Data and Med it is working fine but for Med customer Business Line is not visible.
Please help.
Thanks,
Sam
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:32 AM
Does the 'Med customer' user have those roles?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:37 AM
Yes everything is same. I deleted the user and created the new one. Still same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 03:35 AM
Is my script not correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:06 AM
You have to keep logs and debug Step by Step
1. Is the script Include getting called for 'Med customer' user?
2. If Point1 is yes then Check if there are any ACL or Query BR's restricting the query of sn_install_base_sold_product table.
3. Are there any ACL's restricting Product field access or u_business_line_product field?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2024 12:43 AM - edited 09-20-2024 12:44 AM
Hi @Voona Rohila ,
No for Med business line nothing is returning in the script include. I checked everything. ACL, other business rules.
I am fed up with this issue😥
Thanks,
Sam