SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
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 
Copyright Salesforce 2014. Legal Terms and more here.
Presentation Title Date 
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. 
Q&A
Presentation Title Date 
Copyright Salesforce 2014. Legal Terms and more here.

Weitere ähnliche Inhalte

Was ist angesagt?

Importing data to salesforce
Importing data to salesforceImporting data to salesforce
Importing data to salesforceNetStronghold
 
oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...Nancy Thomas
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersJithin Kuriakose
 
OData, External objects & Lightning Connect
OData, External objects & Lightning ConnectOData, External objects & Lightning Connect
OData, External objects & Lightning ConnectPrasanna Deshpande ☁
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book Feras Ahmad
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
Android SharePoint
Android SharePointAndroid SharePoint
Android SharePointBenCox35
 
Apex basics-for Beginners
Apex basics-for BeginnersApex basics-for Beginners
Apex basics-for Beginnershrakhra
 
UI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 ModelUI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 ModelPatric Ksinsik
 
Rational Publishing Engine and Rational RequisitePro
Rational Publishing Engine and Rational  RequisiteProRational Publishing Engine and Rational  RequisitePro
Rational Publishing Engine and Rational RequisiteProGEBS Reporting
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)Pat Patterson
 
Odata - Open Data Protocol
Odata - Open Data ProtocolOdata - Open Data Protocol
Odata - Open Data ProtocolKhaled Musaied
 
Salesforce Coding techniques that keep your admins happy (DF13)
Salesforce Coding techniques that keep your admins happy (DF13)Salesforce Coding techniques that keep your admins happy (DF13)
Salesforce Coding techniques that keep your admins happy (DF13)Roy Gilad
 
Azure data factory security
Azure data factory securityAzure data factory security
Azure data factory securityMikeBrassil1
 

Was ist angesagt? (20)

Importing data to salesforce
Importing data to salesforceImporting data to salesforce
Importing data to salesforce
 
oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...
 
Oracle ADF Overview for Beginners
Oracle ADF Overview for BeginnersOracle ADF Overview for Beginners
Oracle ADF Overview for Beginners
 
OData, External objects & Lightning Connect
OData, External objects & Lightning ConnectOData, External objects & Lightning Connect
OData, External objects & Lightning Connect
 
Oracle application framework (oaf) online training
Oracle application framework (oaf) online trainingOracle application framework (oaf) online training
Oracle application framework (oaf) online training
 
uppada_kishore_resume (1)
uppada_kishore_resume (1)uppada_kishore_resume (1)
uppada_kishore_resume (1)
 
Extensions in OAF
Extensions in OAF Extensions in OAF
Extensions in OAF
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
Infolets and OTBI Deep link Actionable Reports - Configuration Work Book
 
Practical OData
Practical ODataPractical OData
Practical OData
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
Android SharePoint
Android SharePointAndroid SharePoint
Android SharePoint
 
Apex basics-for Beginners
Apex basics-for BeginnersApex basics-for Beginners
Apex basics-for Beginners
 
UI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 ModelUI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 Model
 
Rational Publishing Engine and Rational RequisitePro
Rational Publishing Engine and Rational  RequisiteProRational Publishing Engine and Rational  RequisitePro
Rational Publishing Engine and Rational RequisitePro
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Odata - Open Data Protocol
Odata - Open Data ProtocolOdata - Open Data Protocol
Odata - Open Data Protocol
 
Salesforce Coding techniques that keep your admins happy (DF13)
Salesforce Coding techniques that keep your admins happy (DF13)Salesforce Coding techniques that keep your admins happy (DF13)
Salesforce Coding techniques that keep your admins happy (DF13)
 
Azure data factory security
Azure data factory securityAzure data factory security
Azure data factory security
 
Oracle application-development-framework-best-practices
Oracle application-development-framework-best-practicesOracle application-development-framework-best-practices
Oracle application-development-framework-best-practices
 

Andere mochten auch

2013 Non-Profit Industry Guide to Dreamforce
2013 Non-Profit Industry Guide to Dreamforce2013 Non-Profit Industry Guide to Dreamforce
2013 Non-Profit Industry Guide to DreamforceSalesforce.org
 
2013 Higher Education Industry Guide to Dreamforce
2013 Higher Education Industry Guide to Dreamforce2013 Higher Education Industry Guide to Dreamforce
2013 Higher Education Industry Guide to DreamforceSalesforce.org
 
Where Marketing Meets CRM
Where Marketing Meets CRMWhere Marketing Meets CRM
Where Marketing Meets CRMSalesforce.org
 
Administrer Salesforce
Administrer SalesforceAdministrer Salesforce
Administrer SalesforceAxel KAMALAK
 
Social Engagement Powering the Connected Nonprofit & Connected Campus
Social Engagement Powering the Connected Nonprofit & Connected CampusSocial Engagement Powering the Connected Nonprofit & Connected Campus
Social Engagement Powering the Connected Nonprofit & Connected CampusSalesforce.org
 
10 Examples of Community Engagement in Higher Ed
10 Examples of Community Engagement in Higher Ed10 Examples of Community Engagement in Higher Ed
10 Examples of Community Engagement in Higher EdSalesforce.org
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David GouldinHeroku
 
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chrono
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chronoHeroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chrono
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chronoSylpheo
 
Salesforce.org Higher Ed Summit 2016 Keynote
Salesforce.org Higher Ed Summit 2016 KeynoteSalesforce.org Higher Ed Summit 2016 Keynote
Salesforce.org Higher Ed Summit 2016 KeynoteSalesforce.org
 
Intro to the Higher Education Advisory Council
Intro to the Higher Education Advisory CouncilIntro to the Higher Education Advisory Council
Intro to the Higher Education Advisory CouncilSalesforce.org
 
Salesforce for Nonprofits: Turn Big Data into Social Change
Salesforce for Nonprofits: Turn Big Data into Social ChangeSalesforce for Nonprofits: Turn Big Data into Social Change
Salesforce for Nonprofits: Turn Big Data into Social ChangeSalesforce.org
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformSalesforce Developers
 
Enterprise Architecture Salesforce
Enterprise Architecture SalesforceEnterprise Architecture Salesforce
Enterprise Architecture SalesforcePeter Doolan
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Developers
 
Salesforce com-architecture
Salesforce com-architectureSalesforce com-architecture
Salesforce com-architecturedrewz lin
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce PresentationChetna Purohit
 

Andere mochten auch (17)

2013 Non-Profit Industry Guide to Dreamforce
2013 Non-Profit Industry Guide to Dreamforce2013 Non-Profit Industry Guide to Dreamforce
2013 Non-Profit Industry Guide to Dreamforce
 
2013 Higher Education Industry Guide to Dreamforce
2013 Higher Education Industry Guide to Dreamforce2013 Higher Education Industry Guide to Dreamforce
2013 Higher Education Industry Guide to Dreamforce
 
Where Marketing Meets CRM
Where Marketing Meets CRMWhere Marketing Meets CRM
Where Marketing Meets CRM
 
Administrer Salesforce
Administrer SalesforceAdministrer Salesforce
Administrer Salesforce
 
Social Engagement Powering the Connected Nonprofit & Connected Campus
Social Engagement Powering the Connected Nonprofit & Connected CampusSocial Engagement Powering the Connected Nonprofit & Connected Campus
Social Engagement Powering the Connected Nonprofit & Connected Campus
 
10 Examples of Community Engagement in Higher Ed
10 Examples of Community Engagement in Higher Ed10 Examples of Community Engagement in Higher Ed
10 Examples of Community Engagement in Higher Ed
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
 
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chrono
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chronoHeroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chrono
Heroku Connect - Synchronisez Heroku et Salesforce en 5 minutes chrono
 
Salesforce.org Higher Ed Summit 2016 Keynote
Salesforce.org Higher Ed Summit 2016 KeynoteSalesforce.org Higher Ed Summit 2016 Keynote
Salesforce.org Higher Ed Summit 2016 Keynote
 
Intro to the Higher Education Advisory Council
Intro to the Higher Education Advisory CouncilIntro to the Higher Education Advisory Council
Intro to the Higher Education Advisory Council
 
Salesforce for Nonprofits: Turn Big Data into Social Change
Salesforce for Nonprofits: Turn Big Data into Social ChangeSalesforce for Nonprofits: Turn Big Data into Social Change
Salesforce for Nonprofits: Turn Big Data into Social Change
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce Platform
 
Enterprise Architecture Salesforce
Enterprise Architecture SalesforceEnterprise Architecture Salesforce
Enterprise Architecture Salesforce
 
Data model in salesforce
Data model in salesforceData model in salesforce
Data model in salesforce
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We Do
 
Salesforce com-architecture
Salesforce com-architectureSalesforce com-architecture
Salesforce com-architecture
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce Presentation
 

Ähnlich wie 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 APISanchit Dua
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
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 Patternsukdpe
 
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, UruguayLuciano Straga
 
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 worldAtul Chhoda
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Appsdreamforce2006
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)Fong Liou
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2jamram82
 
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 ODataPace Integration
 
AGADOS function & feature Chapter-02 biz logic define
AGADOS function & feature Chapter-02 biz logic defineAGADOS function & feature Chapter-02 biz logic define
AGADOS function & feature Chapter-02 biz logic defineYongkyoo Park
 
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
 
Custom Metadata Records Deployment From Apex Code
Custom Metadata Records Deployment From Apex CodeCustom Metadata Records Deployment From Apex Code
Custom Metadata Records Deployment From Apex CodeBohdan Dovhań
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overviewmdc11
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworksbrendonschwartz
 
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 365Kashif Imran
 

Ähnlich wie 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
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
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
 
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
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)
 
RubaDevi_Salesforce
RubaDevi_SalesforceRubaDevi_Salesforce
RubaDevi_Salesforce
 
Dh2 Apps Training Part2
Dh2   Apps Training Part2Dh2   Apps Training Part2
Dh2 Apps Training Part2
 
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
 
AGADOS function & feature Chapter-02 biz logic define
AGADOS function & feature Chapter-02 biz logic defineAGADOS function & feature Chapter-02 biz logic define
AGADOS function & feature Chapter-02 biz logic define
 
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
 
Custom Metadata Records Deployment From Apex Code
Custom Metadata Records Deployment From Apex CodeCustom Metadata Records Deployment From Apex Code
Custom Metadata Records Deployment From Apex Code
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
 
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
 
Salesforce connect
Salesforce connectSalesforce connect
Salesforce connect
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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 Copyright Salesforce 2014. Legal Terms and more here.
  • 14. Presentation Title Date 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. Q&A
  • 15. Presentation Title Date Copyright Salesforce 2014. Legal Terms and more here.