User not visible while populate

Akki1
Tera Contributor

Hi All,

I have s catalog form referenced to Business application and another variable which populates based onChange of Business application it fills with the respective Business Owner and after populating it makes read only. But for some users it populates as blank and makes them read only but if I login as admin and use the same the name is displayed for me.

 Its not for all records  some of them are populated and visible fine

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Akki1 

It seems for non-admin users they don't have access to the table being referred by Business Owner or something is restricting the data

how are you auto populating it? please share that script or logic along with screenshots.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar , 
I am facing the same issue :
The business application owner is a custom field and popus up on the form when related business application is chosen. This works fine for Admins, but doesn't work for Non-admins



User has access to the business application table and can view the record as well.
On change Client script on the Business Application:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue === '') {
        return;
    }

    var app = g_form.getValue('name_of_application');

    var ga = new GlideAjax('businessOwner');
    ga.addParam('sysparm_name', 'getOwner');
    ga.addParam('sysparm_app_name', app);
    ga.getXML(HandleResponse);

	function HandleResponse(response){
    var answer = response.responseXML.documentElement.getAttribute('answer');
        if(answer) {
            alert(answer);
          g_form.setValue('application_business_owner', answer);
        } else {
            g_form.clearValue('application_business_owner');
        }
    }

    //Type appropriate comment here, and begin script below
}

 

Script include:

 
var businessOwner = Class.create();
businessOwner.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    getOwner: function() {
        var appOwner = this.getParameter('sysparm_app_name');
        //var result = '';
        var owner = new GlideRecord('cmdb_ci_business_app');
        if (owner.get(appOwner)) {
          return owner.u_bus_owner;
        } 
    },
    type: 'businessOwner'

});

I just found there is an ACL in script Include which was restricting the execution to only Admins. I have changes it to non-admins, issue is fixed.