How to Make a Dot-Walked Field Read-Only in an Embedded Related List?

Siddhesh Jadhav
Kilo Sage

Hi All,

I have embedded a related list on the `ast_contract` form. In this related list, there is a field `model_number`, which is dot-walked from another table. I need to make this field read-only, but I am facing challenges:

- I tried using an onLoad Client Script, but I couldn't access the embedded related list and the `model_number` field.
- I attempted to use a UI Policy, but since it's an embedded related list, it's not available under UI Policy Related List Actions.

 

Questions:
1. How can I make the `model_number` field in the related list read-only?
2. Is there a way to control the field behavior through Client Scripts, UI Policies, or any other approach?

Any guidance would be appreciated. Thanks in advance!

11 REPLIES 11

Siddhesh Jadhav
Kilo Sage

Hello @Shivalika @Prataps135 @quanth @Robert H , I appreciate your efforts!

 

I have embedded a related list on the ast_contract form. This embedded related list is based on the service_entitlement table, which contains a reference field, model_component, pointing to the product table.

I modified the list layout of this embedded related list and added a dot-walked field, model_number, from the product table. Now, I need to make the model_number field read-only,

 

I have tried the suggested solutions, but I am still facing the following challenges:

 

- Dictionary Override Issue: Since `model_number` is a dot-walked field and not directly present on the `service_entitlement` table, I cannot perform a dictionary override to make it read-only.
- Client Script Limitation: An onLoad Client Script does not work, as I cannot access the embedded related list fields in the script.
- UI Policy Limitation: UI Policies do not apply to embedded related lists, making this approach ineffective.
- ACL Constraint: Applying an ACL to restrict editing would affect the `model_number` field everywhere, not just within the embedded related list.

Would appreciate any further guidance on how to achieve this. Thanks in advance!

Hello @Siddhesh Jadhav 

 

Please refer my reply, I have given the condition to make it specifically for related list. 

 

current.getRefRecord('parent_field').sys_id != current.sys_id" (to restrict in related lists)

 

Please try like this. 

 

Even in BR - you can give this condition, on update BR and condition that "FIELD NAME" changes. 

 

Give this in condition field and abort action. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

I tried the above suggestion, but it is not working

@Shivalika 

I believe it would be great if you could share the BR configuration etc and the actual script which worked for you, some small gif about the testing you performed on that logic

This will help @Siddhesh Jadhav to compare against his component.

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

Yes @Ankur Bawiskar 

 

Actually today I have no access to laptop yet. 

 

Will try something with desktop version on mobile and share screenshot. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY