#

Create a Dynamic Detail Page Button For Any sObject using Meta Data

Core to the Salesforce infrastructure, Metadata is what makes the magic happen!

Metadata is a lightweight language based on XML. In Salesforce, metadata represents the structure of salesforce.com and Force.com development elements. 

Basically, they are the core components or features that relate to the structure of objects and their fields, configurations, logic, code, and page layouts which build your look, feel, and the information architecture of your Salesforce Org. Instead of the traditional development approach, you can import metadata into your Salesforce Org and modify it in the product interface. This is super fast and immediately available through any web browser and there are no downsides to it

Where can you use it?

The change applies to Lightning Experience and Salesforce Classic in Essentials, Professional, Enterprise, Performance, Unlimited, and Developer editions.

Steps to Dynamic Detail Page Button for any sObject:

  • Enter the name of the Button.
  • Select the sObject which you want to Create Button.
  • Hit the button “Create custom Button Link”
  • A button with the label “Save” will be created in the Account Object.

create dynamic page button

Output:-

create dynamic page button

Step 2: To do this, let's start off with a super simple controller. Create Apex class

“CreateCustomButtonLink”

Step 3: Create another apex class “MetadataService”

Step 4: Create Visualforce Page

Conclusion

This simple yet effective method will help you create a dynamic detail page button for the sObject of your choice using Metadata. Try it out and if you come up with any queries regarding this, do reach out!

About the Author



Piyush Singhal

Co-Founder, Director | HIC Global Soutions | Salesforce Consultant | AppExchange Strategist

An outcome-oriented technology leader with a global outlook, Piyush has over 8 years of experience in Project Execution, SDLC Planning, Salesforce, CRM, Salesforce Mobile, and Force.com. Piyush, a seasoned

Salesforce professional, started HIC Global Solutions in 2015 after filling senior development positions at front-running company names in the Salesforce development industry. He looks forward to challenging Salesforce development tasks, delivering novel apps for AppExchange listings, and forging global partnerships through working with the passionate people.


About the Author



Piyush Singhal

Co-Founder, Director | HIC Global Soutions | Salesforce Consultant | AppExchange Strategist

An outcome-oriented technology leader with a global outlook, Piyush has over 8 years of experience in Project Execution, SDLC Planning, Salesforce, CRM, Salesforce Mobile, and Force.com. Piyush, a

seasoned Salesforce professional, started HIC Global Solutions in 2015 after filling senior development positions at front-running company names in the Salesforce development industry. He looks forward to challenging Salesforce development tasks, delivering novel apps for AppExchange listings, and forging global partnerships through working with the passionate people.