servicenow reference field empty in list view but showing on record

irfanhabeeb
Tera Contributor

I have a custom created table u_cmdb_ci_api_partner which is a child of cmdb_ci table . And a 'u_partner_name' field referencing core_company table . Also there is before insert & update BR to populate partner app name from partner name field . 

 

BR 

(function executeRule(current, previous /*null when async*/) {

    if (current.u_partner_name || current.u_api_master) {

        // Get Partner App Name from Company
        if (current.u_partner_name) {
            var company = new GlideRecord('core_company');
            if (company.get(current.u_partner_name)) {
                gs.log("partner name"+current.u_partner_name);
                current.u_partner_app_name = company.u_partner_app_name;
            }
        }

        // Set Name field
        current.name = current.u_partner_name.getDisplayValue() + " " +
                       current.u_api_master.getDisplayValue();
    }

})(current, previous);
 

To check the Br when i tried to edit partner name  from list it is not saving and showing as empty. when go to the certain record and explictly save a value it is hsown on the record form and value(partner app name ) is getting populated. Still in the list view partner name is empty .

 



Action Result
Formshows value
Savelooks saved
List viewempty
List editclears value
1 ACCEPTED SOLUTION

irfanhabeeb
Tera Contributor

The issue was fixed , it was due to a simple error , same field label , but one was dot walked field from another table , And the wrong one was in the default list view 🙂.

Thank you for your help @Ankur Bawiskar @Tanushree Maiti .

View solution in original post

14 REPLIES 14

Hi @Ankur Bawiskar , 
i am trying this in native view . And in BR logs sys id getting correctly.

@irfanhabeeb 

any other logic is clearing that field when you are setting from list?

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

irfanhabeeb
Tera Contributor

1) No ACL List edit on cmdb_ci
2) Display value of refrenced table is true (core_company.name). (it is working in test&dev even without any of the fields setting as display true)
3) No client scripts blocking.

Is there anything left to check in this case?

@irfanhabeeb 

did you check if that record has extra update for clearing the field?

did you enable debug business rules and see from list which all BRs are running?

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

irfanhabeeb
Tera Contributor

The issue was fixed , it was due to a simple error , same field label , but one was dot walked field from another table , And the wrong one was in the default list view 🙂.

Thank you for your help @Ankur Bawiskar @Tanushree Maiti .