Record Producer MRVS (Multi Row Variable Set), hide specific field for specific Record Producer

Dominik21
Tera Contributor

I have MRVS, which is being used in multiple Record Producers. In new Record Producer I am working on, we need to use that MRVS, however one of the variables in this MRVS is not relevant for the new Record Producer and should be permamently hidden (only for that specific new Record Producer). This requirement applies to Service Portal form view and I need to hide this specific variable for both MRVS table that is diplayed on the form and in the Modal form. Is it possible to achieve this using OnLoad Client Script? It can be either Client Script applied to that new Record Producer or Client Script inside that MRVS. Ideally I would like to avoid creating duplicate MRVS for the new Record Producer, because the existing one has complex client scripts which I want to reuse. 

 

I have tried following code inside MRVS OnLoad Client Script to get Sys ID of parent Record Producer, and then hide that variable conditionally, however I am unable to retrieve parent Record Producer Sys ID:

g_service_catalog.parent.getUniqueValue(); // Console error "Not a method"

g_service_catalog.parent.sys_id; // undefined

g_form.getUniqueValue(); // returns Sys ID of MRVS, I don't see a way that this could be helpful in this case

5 REPLIES 5

@Dominik21 

Glad to know that my approached helped.

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