The requirement is to disable/enable some field based on value entered on other field while creating or editing a record, but this needs to happen for one record type. Currently, we have standard page layout in record detail lightening page.

is it possible to add logic to disable fields on record detail out of box component?

Another way that I am thinking of custom LWC to override the New button and Edit button, but can we do it for one particular record type?


2 Answers 2


In standard detail page, dynamically disable the fields can be done only on dependent picklsit, i.e showing different values for picklist in dependent based on master picklist.

Another thing that can restrict user from entering values to a field dynamically using validation rule or trigger.

If you are going for overriding the action, you can not do it based on record types. You need to handle the record types within your components directly.

  • Thanks Sanket, Validation Rule and trigger is last option for us as we wanted to provide the user experience at component level. That leaves a only option to use JavaScript or custom LWC to do this. I am trying to handle record type selection, if user selects that once particular recordtype component will continue to display custom solution else it will redirect to standard create record page(/new?recordTypeId=<recordTYpeID>). Commented Aug 17, 2020 at 6:53

If you are using a custom object, consider using Dynamic Forms which should allow you to provide much finer control on what the user can and cannot see based on visibility rules. It doesn't enable/disable, but rather hide/show, of course.

As to actions, consider using Dynamic Actions which again allow you to have finer control, including making actions available or not based on rules that use record details.

  • Dynamic Form is a solution for us but it is still in beta and we want it for standard object. :) Commented Aug 17, 2020 at 7:06
  • @ManojPatil, fair enough - and why I added the caveat at the start of my answer. I think what this shows is that your question needed to provide more contextual detail :) Still, I will leave my answer as it may help other people who have a similar question for custom objects.
    – Phil W
    Commented Aug 17, 2020 at 7:22
  • @PhiW the issue is more about that even for custom objects, this is a beta feature.
    – zaitsman
    Commented Aug 18, 2020 at 0:02
  • Now a GA feature with Winter '21.
    – Phil W
    Commented Dec 1, 2020 at 21:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .