SlideShare a Scribd company logo
Presentation Title Date 
Best practices in using Salesforce 
Meta Data API 
Naveen Gabrani 
CEO Astrea IT Services 
ngabrani At astreait.com 
@ngabrani 
Copyright Salesforce 2014. Legal Terms and more here. 
Sanchit Dua 
Senior Software Developer Astrea IT Services 
@Sanchit1 
Naveen Gabrani 
CEO Astrea IT Services 
ngabrani At astreait.com
Presentation Title Date 
Copyright Salesforce 2014. Legal Terms and more here. 
Sanchit Dua 
Senior Software Developer Astrea IT Services 
Agenda 
1. What is Metadata 
2. What is Metadata API 
3. How can I access it? 
4. Two type of Metadata operations 
5. Common applications of the Metadata API 
6. Development Scenarios and correct implementation 
7. Best Practices and common issues
Presentation Title Date 
What is Metadata 
 Data: Some thing that is stored in database (accounts) 
 Metadata: Configuration/Code describes how the application looks 
 Shapes the functionality of your specific applications 
 Controls logic and presentation 
What is Metadata API 
 Programmable interface to access Salesforce Metadata 
 Allows you to review/update Metadata components 
 Supported from all modern languages like .Net, Java, PHP 
 Allows you to get/update XML version of an Org 
 SOAP based 
 Supports both Synchronous and Asynchronous invocation 
 Synchronous support added in Summer ’13 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Applications of Metadata API 
 Standard Salesforce tools written using Metadata API 
 Eclipse IDE 
 ANT Migration tool 
 Data loader 
 Standard configuration on all your customer instances 
 Java screens to create Salesforce objects, fields, validation rules etc 
 Regular backup of configuration 
Metadata Components 
Metadata components 
 Object and Field definitions 
 Visualforce pages 
 Page Layouts 
 Validation rules 
 Apex 
 Workflows 
 Profiles 
 Reports 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Metadata API 
CRUD Operations File Based (Declarative) 
Copyright Salesforce 2014. Legal Terms and more here. 
Metadata 
Use this to create/update 
Metadata elements like Objects 
Use this for deploying 
Metadata from one Salesforce 
instance to another 
More Granular Deploy() and Retrieve() 
CRUD based web services 
 Used to create, delete, update sets of Metadata components 
 Create a field 
 Create an object 
 Create a page layout 
 Setting Field Level Security 
 Synchronous Methods as of v-31 (Summer ’14) 
 createMetadata() 
 deleteMetadata() 
 udpateMetadata() 
 upsertMetadata()
Presentation Title Date 
create() flow 
User SFDC 
Copyright Salesforce 2014. Legal Terms and more here. 
AsyncResult object generated. 
Includes ID 
create(new CustomObject(“MyObject”)) 
Return Async Result 
CheckStatus(ID) = done? 
Return Deploy Messages 
CustomObject co = new CustomObject(); 
co.setFullName(uniqueName); 
co.setDeploymentStatus(DeploymentStatus.Deployed 
); 
co.setDescription("Created by Sanchit"); 
co.setEnableActivities(true); 
co.setLabel(label); 
co.setPluralLabel(label + "s"); 
co.setSharingModel(SharingModel.ReadWrite); 
AsyncResult[] results = 
metadataConnection.create(new Metadata[] { co }); 
User 
SFDC CustomObject is <xsd: extension 
base=“tns:Metadata”> 
File based Metadata call 
 File-based Metadata calls 
 Retrieve and deploy XML representations of Metadata 
 Can be used to deploy Metadata from one instance to another 
 Requires package.xml 
 Specifies type of component 
 Specifies names of component
Presentation Title Date 
A typical custom object example 
{File Name: CustomObject/MyObject__c} 
<?xml version="1.0" encoding="UTF-8"?> 
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> 
<deploymentStatus>Deployed</deploymentStatus> 
<fields> 
<fullName>Due_Date__c</fullName> 
<defaultValue>TODAY() + 3</defaultValue> 
<label>Due Date</label> 
<type>Date</type> 
</fields> 
<sharingModel>ReadWrite</sharingModel> 
<recordTypes> 
<fullName>Classification</fullName> 
<active>true</active> 
<description>Classification Records</description> 
<label>Classification</label> 
</recordTypes> 
<recordTypes> 
<fullName>Client_Code</fullName> 
<active>true</active> 
<description>Client Code Records</description> 
<label>Client Code</label> 
</recordTypes> 
</CustomObject> 
Create 
your 
Database 
Tables 
Create 
your 
Database 
Fields 
Copyright Salesforce 2014. Legal Terms and more here. 
Define 
Schema 
attributes 
Metadata API and SOAP API 
Metadata 
Data 
Metadata 
Data 
Metadata 
API 
Web 
Services 
API 
Metadata 
API 
Web 
Services 
API
Presentation Title Date 
Setting up infrastructure 
1. Download the latest WSC – Web Service Connector 
2. From Setup->API 
Enterprise WSDL 
Metadata WSDL 
3. Generate the Jar files from WSDL 
4. Set the classpath of the Application. 
Establishing Connection 
1. Use ConnectorConfig class to set end point to 
https://login.salesforce.com/services/Soap/c/31.0 
2. Use EnterpriseConnection to specify user name and password to login 
3. Initialize Metadata component – e.g CustomObject, CustomField etc. 
4. Pass the Metadata component to create() / update() / delete() call. 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Best Practices and common issues 
Development Scenarios 
 Setting the Page Layout 
 Editing the Profile 
 Creating Record Types 
Enforcing rules at runtime involves recompiling of code (with associated 
possibility of compile time errors). 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Profile Edits 
Configuring a Profile: 
 Open a profile 
 Edit configurations 
NOTE 
 It’s a complex task to achieve via coding without knowing listMetadata() or Workbench. 
 Default Result of listMetadata() as: 
SolutionManager 
Customer Portal Manager 
Standard StandardAul 
Standard 
Chatter Free User 
Chatter External User 
Copyright Salesforce 2014. Legal Terms and more here. 
Admin 
Force%2Ecom - Free User 
MarketingProfile 
Custom%3A Marketing Profile 
HighVolumePortal 
Record Types Creation 
Generally available steps 
 Add a record Type 
 Assign it to layouts and profiles 
 Clicking new on the object view 
NOTE 
 This case is very easily done on declarative platform 
 Doing this via Metadata API is relatively complex
Presentation Title Date 
Insufficient Access On Cross Reference Entity 
 An exception 
 Using Create, Update and Delete 
 Occurs using record type id 
Copyright Salesforce 2014. Legal Terms and more here. 
Demo
Presentation Title Date 
A quirk using Ant Migration Tool 
 Using destructiveChanges.xml 
 To delete a field of type picklist we can’t delete the values instead we delete the 
whole field. 
 This is the limitation of Metadata API. 
Tooling API 
 The tooling API is designed for developing user interface tools to interact with 
the development artifacts in orgs. 
 It can be accessed via SOAP and REST. 
 Developer Console is largely built on the tooling API 
 Best used in conjunction with the Metadata API as a junction. 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Recap 
 Metadata API gives you flexibility to manipulate Salesforce instance 
from outside the platform 
 Two types of Metadata API 
 CRUD based 
 Declarative 
 Application Business process code needs to mimic the user interface 
flow 
 Record Type Creations 
 Profile Edits 
 More important than ever that you define and enforce the boundaries 
 You should respect the intent of platform configurations and not 
surface data in ways that is not permitted. 
Resources 
 Metadata API Developer’s Guide 
 http://www.salesforce.com/us/developer/docs/api_meta 
 https://developer.salesforce.com/en/events/webinars/metadata-api 
 salesforce.stackexchange.com 
 https://github.com/sanchitdua/md_java_asynchronous 
 https://github.com/sanchitdua/md_java_synchronous 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
Copyright Salesforce 2014. Legal Terms and more here. 
Q&A

More Related Content

What's hot

sf tools from community
sf tools from communitysf tools from community
sf tools from community
Durgesh Dhoot
 
Salesforce Lightning Design System
Salesforce Lightning Design SystemSalesforce Lightning Design System
Salesforce Lightning Design System
Durgesh Dhoot
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1
Salesforce Developers
 
SFDC REST API
SFDC REST APISFDC REST API
SFDC REST API
Bohdan Dovhań
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
Salesforce Developers
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar
Abhinav Gupta
 
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
Salesforce Developers
 
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)Yury Bondarau
 
Apex for Admins: Beyond the Basics
Apex for Admins: Beyond the BasicsApex for Admins: Beyond the Basics
Apex for Admins: Beyond the Basics
Salesforce Developers
 
Integrating Salesforce and SharePoint 2013
Integrating Salesforce and  SharePoint 2013Integrating Salesforce and  SharePoint 2013
Integrating Salesforce and SharePoint 2013
Netwoven Inc.
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
Edward Burns
 
Lightning Experience with Visualforce Best Practices
Lightning Experience with Visualforce Best PracticesLightning Experience with Visualforce Best Practices
Lightning Experience with Visualforce Best Practices
Salesforce Developers
 
Coding Apps in the Cloud with Force.com - Part I
Coding Apps in the Cloud with Force.com - Part ICoding Apps in the Cloud with Force.com - Part I
Coding Apps in the Cloud with Force.com - Part I
Salesforce Developers
 
Updates on the Data Center Apps Program
Updates on the Data Center Apps ProgramUpdates on the Data Center Apps Program
Updates on the Data Center Apps Program
Atlassian
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
Bohdan Dovhań
 
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and SwaggerIntroduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Agusto Sipahutar
 
Using Apex for REST Integration
Using Apex for REST IntegrationUsing Apex for REST Integration
Using Apex for REST Integration
Salesforce Developers
 
Interview questions and answers for salesforce developer
Interview questions and answers for salesforce developerInterview questions and answers for salesforce developer
Interview questions and answers for salesforce developer
Pmp15780
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0Buu Nguyen
 

What's hot (19)

sf tools from community
sf tools from communitysf tools from community
sf tools from community
 
Salesforce Lightning Design System
Salesforce Lightning Design SystemSalesforce Lightning Design System
Salesforce Lightning Design System
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1
 
SFDC REST API
SFDC REST APISFDC REST API
SFDC REST API
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar
 
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
Apex for Admins: Get Started with Apex in 30 Minutes! (part 1)
 
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)
Aura Framework and Lightning (Nikolay Zenko and Alexey Filippov)
 
Apex for Admins: Beyond the Basics
Apex for Admins: Beyond the BasicsApex for Admins: Beyond the Basics
Apex for Admins: Beyond the Basics
 
Integrating Salesforce and SharePoint 2013
Integrating Salesforce and  SharePoint 2013Integrating Salesforce and  SharePoint 2013
Integrating Salesforce and SharePoint 2013
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
 
Lightning Experience with Visualforce Best Practices
Lightning Experience with Visualforce Best PracticesLightning Experience with Visualforce Best Practices
Lightning Experience with Visualforce Best Practices
 
Coding Apps in the Cloud with Force.com - Part I
Coding Apps in the Cloud with Force.com - Part ICoding Apps in the Cloud with Force.com - Part I
Coding Apps in the Cloud with Force.com - Part I
 
Updates on the Data Center Apps Program
Updates on the Data Center Apps ProgramUpdates on the Data Center Apps Program
Updates on the Data Center Apps Program
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and SwaggerIntroduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
Introduction Asp.Net Core, MVC, Docker (Linux), Postman and Swagger
 
Using Apex for REST Integration
Using Apex for REST IntegrationUsing Apex for REST Integration
Using Apex for REST Integration
 
Interview questions and answers for salesforce developer
Interview questions and answers for salesforce developerInterview questions and answers for salesforce developer
Interview questions and answers for salesforce developer
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0
 

Viewers also liked

Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
Salesforce Developers
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummiesdreamforce2006
 
Best Practices for Salesforce Admins at Dreamforce 2016
Best Practices for Salesforce Admins at Dreamforce 2016Best Practices for Salesforce Admins at Dreamforce 2016
Best Practices for Salesforce Admins at Dreamforce 2016
Salesforce Admins
 
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
Vivek Chawla
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
Daniel Ballinger
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Dreamforce
 
Salesforce Admin Habits & Stats
Salesforce Admin Habits & StatsSalesforce Admin Habits & Stats
Salesforce Admin Habits & Stats
Cloudingo
 
Continuous Integration with Bamboo for Salesforce
Continuous Integration with Bamboo for SalesforceContinuous Integration with Bamboo for Salesforce
Continuous Integration with Bamboo for Salesforce
Klea Kolaric
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
Paris Salesforce Developer Group
 
Salesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinarSalesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinar
Salesforce Developers
 
Dreamforce14 Multi Org Collaboration Architecture
Dreamforce14  Multi Org Collaboration ArchitectureDreamforce14  Multi Org Collaboration Architecture
Dreamforce14 Multi Org Collaboration Architecture
Richard Clark
 
Best practice strategies to clean up and maintain your database with Hether G...
Best practice strategies to clean up and maintain your database with Hether G...Best practice strategies to clean up and maintain your database with Hether G...
Best practice strategies to clean up and maintain your database with Hether G...
Blackbaud Pacific
 

Viewers also liked (12)

Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
 
S-Controls for Dummies
S-Controls for DummiesS-Controls for Dummies
S-Controls for Dummies
 
Best Practices for Salesforce Admins at Dreamforce 2016
Best Practices for Salesforce Admins at Dreamforce 2016Best Practices for Salesforce Admins at Dreamforce 2016
Best Practices for Salesforce Admins at Dreamforce 2016
 
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
Five Enterprise Best Practices That EVERY Salesforce Org Can Use (DF15 Session)
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
 
Salesforce Admin Habits & Stats
Salesforce Admin Habits & StatsSalesforce Admin Habits & Stats
Salesforce Admin Habits & Stats
 
Continuous Integration with Bamboo for Salesforce
Continuous Integration with Bamboo for SalesforceContinuous Integration with Bamboo for Salesforce
Continuous Integration with Bamboo for Salesforce
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
 
Salesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinarSalesforce API Series: Release Management with the Metadata API webinar
Salesforce API Series: Release Management with the Metadata API webinar
 
Dreamforce14 Multi Org Collaboration Architecture
Dreamforce14  Multi Org Collaboration ArchitectureDreamforce14  Multi Org Collaboration Architecture
Dreamforce14 Multi Org Collaboration Architecture
 
Best practice strategies to clean up and maintain your database with Hether G...
Best practice strategies to clean up and maintain your database with Hether G...Best practice strategies to clean up and maintain your database with Hether G...
Best practice strategies to clean up and maintain your database with Hether G...
 

Similar to Best practices in using Salesforce Metadata API

Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
Sanchit Dua
 
Summer '16 Realease notes
Summer '16 Realease notesSummer '16 Realease notes
Summer '16 Realease notesaggopal1011
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
ukdpe
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
Robert J. Stein
 
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, UruguayPunta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
Luciano Straga
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
Naga Muruga
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real worldAtul Chhoda
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
Atul Chhoda
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Appsdreamforce2006
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
Pace Integration
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksSunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworksSunil Patil
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
mdc11
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
David Solivan
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2jamram82
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
Steve Speicher
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
Kashif Imran
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
Mark Gu
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)
Fong Liou
 

Similar to Best practices in using Salesforce Metadata API (20)

Best practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata APIBest practices in using Salesforce Metadata API
Best practices in using Salesforce Metadata API
 
Summer '16 Realease notes
Summer '16 Realease notesSummer '16 Realease notes
Summer '16 Realease notes
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, UruguayPunta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Apps
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
 
RubaDevi_Salesforce
RubaDevi_SalesforceRubaDevi_Salesforce
RubaDevi_Salesforce
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
 
Innovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC IntegrationsInnovate2011 Keys to Building OSLC Integrations
Innovate2011 Keys to Building OSLC Integrations
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)
 

Recently uploaded

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Best practices in using Salesforce Metadata API

  • 1. Presentation Title Date Best practices in using Salesforce Meta Data API Naveen Gabrani CEO Astrea IT Services ngabrani At astreait.com @ngabrani Copyright Salesforce 2014. Legal Terms and more here. Sanchit Dua Senior Software Developer Astrea IT Services @Sanchit1 Naveen Gabrani CEO Astrea IT Services ngabrani At astreait.com
  • 2. Presentation Title Date Copyright Salesforce 2014. Legal Terms and more here. Sanchit Dua Senior Software Developer Astrea IT Services Agenda 1. What is Metadata 2. What is Metadata API 3. How can I access it? 4. Two type of Metadata operations 5. Common applications of the Metadata API 6. Development Scenarios and correct implementation 7. Best Practices and common issues
  • 3. Presentation Title Date What is Metadata  Data: Some thing that is stored in database (accounts)  Metadata: Configuration/Code describes how the application looks  Shapes the functionality of your specific applications  Controls logic and presentation What is Metadata API  Programmable interface to access Salesforce Metadata  Allows you to review/update Metadata components  Supported from all modern languages like .Net, Java, PHP  Allows you to get/update XML version of an Org  SOAP based  Supports both Synchronous and Asynchronous invocation  Synchronous support added in Summer ’13 Copyright Salesforce 2014. Legal Terms and more here.
  • 4. Presentation Title Date Applications of Metadata API  Standard Salesforce tools written using Metadata API  Eclipse IDE  ANT Migration tool  Data loader  Standard configuration on all your customer instances  Java screens to create Salesforce objects, fields, validation rules etc  Regular backup of configuration Metadata Components Metadata components  Object and Field definitions  Visualforce pages  Page Layouts  Validation rules  Apex  Workflows  Profiles  Reports Copyright Salesforce 2014. Legal Terms and more here.
  • 5. Presentation Title Date Metadata API CRUD Operations File Based (Declarative) Copyright Salesforce 2014. Legal Terms and more here. Metadata Use this to create/update Metadata elements like Objects Use this for deploying Metadata from one Salesforce instance to another More Granular Deploy() and Retrieve() CRUD based web services  Used to create, delete, update sets of Metadata components  Create a field  Create an object  Create a page layout  Setting Field Level Security  Synchronous Methods as of v-31 (Summer ’14)  createMetadata()  deleteMetadata()  udpateMetadata()  upsertMetadata()
  • 6. Presentation Title Date create() flow User SFDC Copyright Salesforce 2014. Legal Terms and more here. AsyncResult object generated. Includes ID create(new CustomObject(“MyObject”)) Return Async Result CheckStatus(ID) = done? Return Deploy Messages CustomObject co = new CustomObject(); co.setFullName(uniqueName); co.setDeploymentStatus(DeploymentStatus.Deployed ); co.setDescription("Created by Sanchit"); co.setEnableActivities(true); co.setLabel(label); co.setPluralLabel(label + "s"); co.setSharingModel(SharingModel.ReadWrite); AsyncResult[] results = metadataConnection.create(new Metadata[] { co }); User SFDC CustomObject is <xsd: extension base=“tns:Metadata”> File based Metadata call  File-based Metadata calls  Retrieve and deploy XML representations of Metadata  Can be used to deploy Metadata from one instance to another  Requires package.xml  Specifies type of component  Specifies names of component
  • 7. Presentation Title Date A typical custom object example {File Name: CustomObject/MyObject__c} <?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <deploymentStatus>Deployed</deploymentStatus> <fields> <fullName>Due_Date__c</fullName> <defaultValue>TODAY() + 3</defaultValue> <label>Due Date</label> <type>Date</type> </fields> <sharingModel>ReadWrite</sharingModel> <recordTypes> <fullName>Classification</fullName> <active>true</active> <description>Classification Records</description> <label>Classification</label> </recordTypes> <recordTypes> <fullName>Client_Code</fullName> <active>true</active> <description>Client Code Records</description> <label>Client Code</label> </recordTypes> </CustomObject> Create your Database Tables Create your Database Fields Copyright Salesforce 2014. Legal Terms and more here. Define Schema attributes Metadata API and SOAP API Metadata Data Metadata Data Metadata API Web Services API Metadata API Web Services API
  • 8. Presentation Title Date Setting up infrastructure 1. Download the latest WSC – Web Service Connector 2. From Setup->API Enterprise WSDL Metadata WSDL 3. Generate the Jar files from WSDL 4. Set the classpath of the Application. Establishing Connection 1. Use ConnectorConfig class to set end point to https://login.salesforce.com/services/Soap/c/31.0 2. Use EnterpriseConnection to specify user name and password to login 3. Initialize Metadata component – e.g CustomObject, CustomField etc. 4. Pass the Metadata component to create() / update() / delete() call. Copyright Salesforce 2014. Legal Terms and more here.
  • 9. Presentation Title Date Best Practices and common issues Development Scenarios  Setting the Page Layout  Editing the Profile  Creating Record Types Enforcing rules at runtime involves recompiling of code (with associated possibility of compile time errors). Copyright Salesforce 2014. Legal Terms and more here.
  • 10. Presentation Title Date Profile Edits Configuring a Profile:  Open a profile  Edit configurations NOTE  It’s a complex task to achieve via coding without knowing listMetadata() or Workbench.  Default Result of listMetadata() as: SolutionManager Customer Portal Manager Standard StandardAul Standard Chatter Free User Chatter External User Copyright Salesforce 2014. Legal Terms and more here. Admin Force%2Ecom - Free User MarketingProfile Custom%3A Marketing Profile HighVolumePortal Record Types Creation Generally available steps  Add a record Type  Assign it to layouts and profiles  Clicking new on the object view NOTE  This case is very easily done on declarative platform  Doing this via Metadata API is relatively complex
  • 11. Presentation Title Date Insufficient Access On Cross Reference Entity  An exception  Using Create, Update and Delete  Occurs using record type id Copyright Salesforce 2014. Legal Terms and more here. Demo
  • 12. Presentation Title Date A quirk using Ant Migration Tool  Using destructiveChanges.xml  To delete a field of type picklist we can’t delete the values instead we delete the whole field.  This is the limitation of Metadata API. Tooling API  The tooling API is designed for developing user interface tools to interact with the development artifacts in orgs.  It can be accessed via SOAP and REST.  Developer Console is largely built on the tooling API  Best used in conjunction with the Metadata API as a junction. Copyright Salesforce 2014. Legal Terms and more here.
  • 13. Presentation Title Date Recap  Metadata API gives you flexibility to manipulate Salesforce instance from outside the platform  Two types of Metadata API  CRUD based  Declarative  Application Business process code needs to mimic the user interface flow  Record Type Creations  Profile Edits  More important than ever that you define and enforce the boundaries  You should respect the intent of platform configurations and not surface data in ways that is not permitted. Resources  Metadata API Developer’s Guide  http://www.salesforce.com/us/developer/docs/api_meta  https://developer.salesforce.com/en/events/webinars/metadata-api  salesforce.stackexchange.com  https://github.com/sanchitdua/md_java_asynchronous  https://github.com/sanchitdua/md_java_synchronous Copyright Salesforce 2014. Legal Terms and more here.
  • 14. Presentation Title Date Copyright Salesforce 2014. Legal Terms and more here. Q&A