0

We are developing a custom lighting web component where we have a requirement to show a set of custom action buttons. The same set of custom buttons are also added to the page layout of the custom object. We want show the buttons in the lightning web component only if those are added to the page layout. In other words - if the user removes any of the custom buttons from the page layout those options should be hidden from the lighting web component action button list as well.

So I am trying to see if I can access the page layout and its associted properties using Apex.

Could you please suggest if you have solved these type of requirements in any of your projects?

Thanks, Bikram.

1

You can access this information using the Apex Metadata API, via the Layout class's customButtons property. Note that doing so is a callout behind the scenes and completes asynchronously; integrating it into your Lightning controller architecture may be challenging.

Your other, perhaps superior, option is to make a callout to the UI API from either JavaScript or the frontend. Hit the Get Record Detail Page Actions endpoint to get information about the Quick Actions and buttons on a layout for a specific record.

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.