HR Case - Client Script

Dharma Liyanag
Tera Guru

Hi There,

What is the reason for this ? Statement :  g_form.getDisplayValue('hr_service')

HR Agent Workspace displays the correct Hr Service when I use this statement in On Change Client Script, where as the same statement returns the HR Case # in the classic Default View.

 

Appreciate any explanation on this.

Thanks! 

 

 

 
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Dharma Liyanag 

I used this script in onload client script on HR Total Rewards table and it gave me different value in both native and workspace

So it seems OOB behavior.

For native it gave me HR Case number

AnkurBawiskar_1-1735977403159.png

 

For workspace it gave me HR Service value

AnkurBawiskar_0-1735977343073.png

I also verified with incident table and assigned_to field, so same behavior observed.

Seems it's a platform thing.

If you want display value in reference field then in native you can use this

var val = g_form.getDisplayBox('hr_service').value;

For workspace you need to do GlideAjax

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Dharma Liyanag 

ideally it should give the same value

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Dharma Liyanag 

I used this script in onload client script on HR Total Rewards table and it gave me different value in both native and workspace

So it seems OOB behavior.

For native it gave me HR Case number

AnkurBawiskar_1-1735977403159.png

 

For workspace it gave me HR Service value

AnkurBawiskar_0-1735977343073.png

I also verified with incident table and assigned_to field, so same behavior observed.

Seems it's a platform thing.

If you want display value in reference field then in native you can use this

var val = g_form.getDisplayBox('hr_service').value;

For workspace you need to do GlideAjax

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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