GlideSysTitle.getTitle() returns full title for incident, but only number for wm_order

Nihal Sarawgi1
Tera Contributor

Hi everyone,

 

I'm trying to understand how GlideSysTitle.getTitle() determines the record title format across different tables.

For the incident table, I get a properly formatted title like:

 
INC0012345 - Short description text

 

But for wm_order (an out-of-box table from Field Service Management), the same code returns only the record number, like:

 

WO0001234

 

Here’s my script:

 

 
var titleGr = new GlideRecord('wm_order');
titleGr.get('da69643897b96210d725fb11a153af71');
var trigger_desc = titleGr.getDisplayValue();
gs.print(trigger_desc); // Outputs: WO0001234

var titleConfig = new GlideSysTitle('wm_order');
var trigger_desc2 = titleConfig.getTitle(titleGr);
gs.print(trigger_desc2); // Also outputs: WO0001234
 

 

Questions:

  1. How does GlideSysTitle decide what fields to include in the title?

  2. Is there a way to configure the title format for wm_order similar to how incident shows number + short description?

  3. Is this defined somewhere like a "record title template" or metadata?

@Chuck Tomasi @Pradeep Sharma 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Nihal Sarawgi1 

it comes from this table  -> "sys_ui_title"

It uses the Title configuration for that table, if present

If not present then it simply picks the field value which is marked Display=true at that table

See below for INC the configuration is present but it's not there for wm_order and hence it only prints number

AnkurBawiskar_0-1748868388412.png

 

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

@Nihal Sarawgi1 

Hope you are doing good.

Did my reply answer your question?

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

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Nihal Sarawgi1 

it comes from this table  -> "sys_ui_title"

It uses the Title configuration for that table, if present

If not present then it simply picks the field value which is marked Display=true at that table

See below for INC the configuration is present but it's not there for wm_order and hence it only prints number

AnkurBawiskar_0-1748868388412.png

 

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

@Nihal Sarawgi1 

Hope you are doing good.

Did my reply answer your question?

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

Thankyou @Ankur Bawiskar  for the quick solution. It worked ! 

Vutikonda Vinay
Tera Contributor

Hello @Nihal Sarawgi1 ,

 

You have to navigate the sys_ui_title.LIST table there verify the wm_order table record if not then create a table and add a short description field under Fileds.

 

Refresh the script page and try with the same wm_order table script you have. Verify the results and let me know.

 

I have found the reference article too: https://www.servicenow.com/community/servicenow-ai-platform-forum/where-can-i-find-the-code-for-task...

 

Thank you!