There is a managed package in salesforce. I am trying to extend its class by adding some code in it. I have created a custom button. That button is visible on page layout by default in classic mode. But for lightning mode, I have to manually drag and drop it from mobile and lightning actions option. Is there any way through which I can do it programatically rather than just manual drag and drop in lightning mode ? Same with visualforce page. I can see available custom button and there is option to add it. But this is manual drag and drop. Is there any way I can do this programatically without having to do manual drag and drop ?

1 Answer 1


You can directly update the Layout metadata. You would retrieve the layout metadata file, the dependencies (the button etc.) preferably using Salesforce VS Code, then modify the metadata to include the button on the layout and deploy your changes back to the org.

You must log in to answer this question.

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