List view Disable links except number field.

Khalid9030
Tera Contributor

Hi Team,

 

We have custom table in the list view i want to disable all reference field links except number field. How we can do using the list control.  in the list control i can see the option Omit links if i enable this all fields are omitted but i want number field should be remains same. 

 

3 REPLIES 3

Harsh_Deep
Giga Sage
Giga Sage

Hello @Khalid9030 

 

You can remove link in the list view by going into the list control. Right click on the list header go to Configure -> List Control and check the Omit Links checkbox as shown in the below snapshots

 

1.PNG

 

find_real_file.png

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

Sagar Pagar
Tera Patron

Hi @Khalid9030,

 

I do not believe it is possible. As a result, if we set Omit links to true, link will be removed from all columns. As per OOTB configurations, this is expected behavior.

 

 

Alternatively, you can add the dot walk field to the list layout, so that the links to the referenced records will be removed.

 

Take a look at:

Remove hypertext for reference field in list view 

Disable Clickable link from list layout 

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Khalid9030 ,

 

Follow these step after doing omit links as true n saving it.(Untested)

 

Override Link Behavior for the "Number" Field:

 

To ensure the "Number" field remains a clickable link, you will need to override its link behavior using a client script.

Create a client script (type: "OnChange") or UI Policy to set the link behavior for the "Number" field.

For example, if your custom table's number field is called "custom_number_field", you can use the following script to set the link behavior for this field:

 

if (current.table == 'your_custom_table_name' && current.name == 'custom_number_field') {

    g_form.setDisplay('custom_number_field', true); // Ensure the field is displayed in list view

   g_form.getControl('custom_number_field').setAttribute('href', 'your_link_target'); // Set the desired link target

} else {

    g_form.setDisplay('custom_number_field', false); // Hide the field in list vi

ew

}

 

Modify the script as per your need.

 

Thanks,

Danish