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 

client script is on which table?

please share some details.

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

Runjay Patel
Giga Sage

Hi @Dharma Liyanag ,

 

Where are you writing the code? HR Service does not hold any case value.

Share your on change client script.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Hi Runjay,

The client script to display custom subcategory list based on the hr_service ( some Record Producer variable values ); This is created in HR Case form ( sn_hr_core_case )

DharmaLiyanag1_0-1736004142535.png

 

@Dharma Liyanag I recommend reporting this issue to ServiceNow support as they may create a problem ticket to address this issue in the future release.