Choice value is not visible to customer but admin can see

Samiksha2
Mega Sage

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

15 REPLIES 15

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

Yes everything is same. I deleted the user and created the new one.  Still same issue.

Is my script not correct?

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

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😥

 

Samiksha2_0-1726818245169.png

 



Thanks,
Sam