function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MoonMoon 

Creating and adding a new "Custom Button" to object's layout via API

Hello,

 

I am currently bulding an integration application which allows Salesforece object to sync data with a SharePoint list.

We need a way to create and add a custom button to object's layout through dynamically.

 

Is it possible to create and add a custom button via API?

 

FYI, the custom button will execute the following Javascript

 

window.open('/apex/Redirect?control=workplan&object=MyApp__Project__c&id={!MyApp__Project__c.Id}', 'Work Planner', 'height = 600, width = 1000');

 

We need to add the button dynamically because the value for the controlobject and title (Work Planner) parameters will be determined at the time user maps the object in Salesforce to a list in SharePoint from the UI provided by SharePoint.

 

Thanks a lot for looking into this.

BinayakBinayak

We can use MetaData API for this purpouse as there is an attribute customButton over there

MoonMoon

Would you be ablse to share some links / sample code ... if you have some?