We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to make Requested For, Request Number, and Item Name read-only but still keep the Info (ⓘ) icon

JyotiranjanC566
Giga Contributor

Hi everyone,

I'm working on the Requested Item form (sc_req_item) and I need to make the following fields read-only:

  • Requested For

  • Request (REQ Number)

  • Item (Catalog Item)

The requirement is that users should not be able to modify these fields, but we still want the Info (ⓘ) icon to remain visible so users can open the referenced record and check its details.

Currently I tried using a Client Script (onLoad) like this:

function onLoad() {

    g_form.setReadOnly('cat_item', true);
    g_form.setReadOnly('request', true);
    g_form.setReadOnly('requested_for', true);

}

However, when the field is disabled the ⓘ info icon disappears, which prevents users from viewing the referenced record.

I also verified the dictionary attributes for the reference field and they include:

ref_contributions=show_related_link

My question:

What is the best practice to:

  1. Make these fields read-only on the RITM form

  2. Prevent users from editing them

  3. Still keep the ⓘ info icon visible so users can open the referenced record?

0 REPLIES 0