1

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?

Thanks.

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.

| improve this answer | |
  • 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>). – Manoj Patil Aug 17 at 6:53
2

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.

| improve this answer | |
  • Dynamic Form is a solution for us but it is still in beta and we want it for standard object. :) – Manoj Patil Aug 17 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 Aug 17 at 7:22
  • @PhiW the issue is more about that even for custom objects, this is a beta feature. – zaitsman Aug 18 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.