Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Unable see 'Employee Number' in the 'Opened for' & 'Subject Person' fields on the HR Case creation UI Page

Abhinandan Pati
Giga Guru

I would like to see 'Employee Number' while searching for users in the 'Opened for' and 'Subject Person' fields present on the 'Case Details' section of HR case creation UI page: 'case_creation'. I have referred below links and updated the method '_addReferenceProperties' in 'hr_CaseCreation' script include.

https://community.servicenow.com/community?id=community_article&sys_id=3b592ed1dbd908941cd8a345ca961...

https://community.servicenow.com/community?id=community_question&sys_id=d486d269db03c8504819fb243996...

I am able to see Email and User ID but for some reason same code snippet is not working for employee number. Here is the code snippet. Please guide if I am missing something here.

if (fieldObject.column_name == 'opened_for' || fieldObject.column_name == 'subject_person') {
            fieldObject.attributes = "ref_auto_completer=AJAXTableCompleter,ref_ac_columns=employee_number";
        }

Thanks,

Abhinandan

@Chuck Tomasi @Göran Lundqvist @Ankur Bawiskar @Robert Duca @nathanfirth 

5 REPLIES 5

Ankur Bawiskar
Tera Patron

Hi Abhinandan,

Will check and let you know if anything found around this.

Also since this UI page is out of the box; if you change/add something to this to cater your current requirement care needs to be taken when upgrade happens and if this UI page is updated by ServiceNow.

Regards

Ankur

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

Abhinandan Pati
Giga Guru

Hi Ankur,

I am making these changes on copied version of 'case_creation' UI page and not the OOB UI page and I was able to show employee_number with the help of below article but now I want to show multiple field values like 'employee_number' , 'location' and with help of article I made below changes in the 'case_creation' UI page [line number 887 in Client Script] and 'hr_CaseCreation' Script Include. But it's not showing multiple field values.I tried with 'sn-record-picker' as well but it did not help.

https://community.servicenow.com/community?id=community_article&sys_id=3b592ed1dbd908941cd8a345ca961...

Can we just add property in 'sn-reference-picker' directive or any additional steps needs to be taken to make it work?  

Please share your thoughts.

case_creation UI Page

'<sn-reference-picker id="" ref-value="" class="ev-field-reference" field="field" ed="field" sn-disabled="disabled" sn-options="options" sn-on-change="refOnChange(field)" ref-table="field.refTable" ref-id="field.refId" additional-display-columns=""/>'

hr_CaseCreation Script Include

fieldObject.attributes = "ref_ac_columns=employee_number,ref_ac_order_by=name,ref_auto_completer=AJAXTableCompleter";
fieldObject.additionalDisplayColumns = ["employee_number", "location"];

Thanks,

Abhinandan

@nathanfirth 

Hi @Abhinandan Patil @Ankur Bawiskar 

Are you still having this issue?

I've managed to make it work.

Thanks,

Ludijor Barros

@Ludijor 

please share the approach so that it would be helpful to members as well.

Regards
Ankur

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