How to find a related list back end name?

Community Alums
Not applicable

Hi All,

I need to hide a related list based on field1 value. My related list name "Test Requests", i have written the below code. It is not working.

function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('u_request') == 'test') {
g_form.hideRelatedList('test_requests');
} else {
g_form.hideRelatedList('test_requests');
}
}

 

Regards,

Sirraj

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sirraj 

try to configure the list control for that related list

Then pick the name from there

find_real_file.png

find_real_file.png

Regards
Ankur

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

View solution in original post

10 REPLIES 10

Community Alums
Not applicable

Hi Ankur,

I am getting kind of sys_id as shown below, can i use the same?

find_real_file.png

 

Regarding,

Sirraj

Hi,

then use that in the function

Since that may be the defined relationships so it shows in that syntax

Regards
Ankur

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

Community Alums
Not applicable

Yes, that worked. So its an expected behaviour only rite? if names are not showing i can use that sysid?

@Sirraj 

Glad to know that my response helped.

Yes that should be fine to use that sys_id.

Yes it is known behavior.

For defined relationship that is the syntax

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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

Jaspal Singh
Mega Patron
Mega Patron

Hi Sirraj,

 

From the screenshot provided it seems it is a custom relationshipt that is created & thus will show sys_id & is an expected behavior.

Unsure about the reason but possibly it is to differentiate between custom & OOB available relationships.