API
www.cloudanalogy.com
Ajay Dubedi
Salesforce Expert
www.cloudanalogy.com
First you need to understand data. What is data in context with Salesforce.
Data is anything which is stored in a database like records related to Contacts,
Accounts, Leads Opportunity etc.
Metadata:
Metadata can be defined as the set of data about another data. i.e.,
Configuration/Code/Logic of the underlying structure which is used to store the
data (Records).
Another definition is you can say the database structure in which you will be
saving the data.
MetaData API
Metadata Api for Salesforce can do several things
programmatically.You can read, create, update, delete
following components in a Salesforce organization.
1. Custom Objects/Fields.
2. Visualforce pages.
3. Page Layouts.
4. Validation rules.
5. Apex.
6. Workflows.
7. Approval processes.
8. Profiles.
9. Reports etc.
10. Security.
www.cloudanalogy.com
MetaData API
You can configure a Salesforce organization just by running a piece of code. In contrast
to this I meant to say that you can create Objects,Fields,Validation,Workflows, Profiles,
Reports for a particular client organization just by running the piece of code so that you
need not do all the customisation settings manually which will consume time if you have
to do that several times for different clients for the same configuration settings.
You can also take the backup of your organization customisation settings just by
fetching the metadata WSDL from your Salesforce org.
For this You need to click setup>type API-Click on API >Click Generate metadata WSDL
and download the xml file.
www.cloudanalogy.com
MetaData API
There are two types of Metadata API calls:
1. Synchronous:-
This will give the result immediately as
soon as you call a method.
2. Asynchronous:-
This will not give result immediately, it will
take time.
Asynchronous :
There are four types of methods which we can use:
1. Create();
2. Update();
3. Upsert();
4. Delete();
www.cloudanalogy.com
MetaData API
Synchronous :
There are four types of methods which we can use:
createMetadata(); saveResult[] = metadataConnection.createMetadata(Metadata[] metadata);
readMetadata();readResult=metadataConnection.readMetadata(stringmetadataType,string[]
fullNames);
updateMetadata(); saveResult[] = metadataConnection.updateMetadata(Metadata[] metadata);
upsertMetadata(); upsertResult[] = metadataConnection.upsertMetadata(Metadata[] metadata);
deleteMetadata(); seleteResult[] = metadataConnection.delete(string metadataType, string[] fullNames);
All these classes saveResult,readResult, upsertResult,deleteResult comes from a main class that is
MetadataService.cls in which all the relevant methods are present to function Read, Create, Update,
Upsert or Delete properly.
www.cloudanalogy.com
MetaData API
MetadataService is a class which have several methods and used in these methods.
So now if you want to create the object then you just have to call this method like this:
YourClassName.createObject();
Firstly you have to deploy these classes in your org. check this link for all the classes in
metadata sample and add them to your org
If you face some problem like : Remote site settings error. Then just create a remote site
setting in your org by typing remote site settings in setup and in Remote site URL paste
the link and click save.
As you call this method like for example in the Execute Anonymous section then it will
create an object named as Test.
www.cloudanalogy.com
MetaData API
To Create a Custom Object:
You need to add this code to your class which you are using
and call this method via class name to create the object.
www.cloudanalogy.com
MetaData API
To Upsert a Custom Object:
www.cloudanalogy.com
MetaData API
To Create a Custom Field:
www.cloudanalogy.com
MetaData API
To Delete the Custom field:
www.cloudanalogy.com
MetaData API
To Update the Field:
www.cloudanalogy.com
MetaData API
To Update Field Level Security:
www.cloudanalogy.com
MetaData API
To Create a Page:
www.cloudanalogy.com
MetaData API
Sample Custom Code:
For creation of a Visualforce page.
www.cloudanalogy.com
MetaData API
www.cloudanalogy.com
MetaData API
For Deleting the Created Visualforce page:
www.cloudanalogy.com
MetaData API
Ajay Dubedi
Salesforce Expert
www.cloudanalogy.com
+1 (415) 830-3899
hello@cloudanalogy.com ajay.dubedi

More Related Content

PPTX
Salesforce ANT migration
PDF
Best practices in using Salesforce Metadata API
PDF
Webservices in SalesForce (part 1)
PPTX
Using the Tooling API to Generate Apex SOAP Web Service Clients
PPT
Entity frameworks101
PPTX
PPT
New Features Of ASP.Net 4 0
Salesforce ANT migration
Best practices in using Salesforce Metadata API
Webservices in SalesForce (part 1)
Using the Tooling API to Generate Apex SOAP Web Service Clients
Entity frameworks101
New Features Of ASP.Net 4 0

What's hot (20)

PPT
Tumbleweed intro
PPT
Microsoft Azure
PPTX
mule salesforce
 
PPTX
Amazone s3 in mule
ODP
Mongo db rev001.
PPTX
Azure rev002
PDF
Progressive EPiServer Development
PPT
PPT
Road Show Asp Net
PPTX
Web API with ASP.NET MVC by Software development company in india
PPTX
Access Services On SharePoint 2010
PDF
Share point review qustions
PPTX
Automated Testing Of EPiServer CMS Sites
PDF
Hooking SharePoint APIs with Android
PPTX
EPiServer Deployment Tips & Tricks
PPTX
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
PPTX
SharePoint 2010 Application Development Overview
PDF
.NET Core, ASP.NET Core Course, Session 7
PPTX
Mulesoft salesforce connector to update Object.
PPTX
Develop iOS and Android apps with SharePoint/Office 365
Tumbleweed intro
Microsoft Azure
mule salesforce
 
Amazone s3 in mule
Mongo db rev001.
Azure rev002
Progressive EPiServer Development
Road Show Asp Net
Web API with ASP.NET MVC by Software development company in india
Access Services On SharePoint 2010
Share point review qustions
Automated Testing Of EPiServer CMS Sites
Hooking SharePoint APIs with Android
EPiServer Deployment Tips & Tricks
AWS Atlanta meetup Build Tools - Code Commit, Code Build, Code Deploy
SharePoint 2010 Application Development Overview
.NET Core, ASP.NET Core Course, Session 7
Mulesoft salesforce connector to update Object.
Develop iOS and Android apps with SharePoint/Office 365
Ad

Viewers also liked (20)

PPTX
Salesforce Google Maps Integration
PDF
Drag and Drop Slide Installation and Configuration
PDF
Salesforce API Series: Release Management with the Metadata API webinar
PPTX
"Has knowledge brought justice"? A survivor's perspective.
DOCX
Ensayo del tema Investigación
PPTX
Unit 14 LO1
PPTX
Graded Care Profile
PPTX
Unit 13 LO2
PDF
Forester v1.0
DOCX
Taller de Tesis I, Tesis, Elaboración, Disertación, Bolivie, Bioética, Piel B...
DOCX
Educación Productiva, Educación, Intercultural, Pluricultural, Bolivia, Gorge...
PPTX
Listening to Mum
PPTX
Towards more child-centred investigations Part 1
PPTX
What is effective communication in child protection social work? Developing a...
PPTX
Brain Behind, Body Forward
DOCX
Warehouse
DOC
2016 коллективный договор оцбс
PPTX
School and domestic violence in interaction: Russian experience
PPTX
The other Kinship Carers
PDF
All About Mobile App Remarketing
Salesforce Google Maps Integration
Drag and Drop Slide Installation and Configuration
Salesforce API Series: Release Management with the Metadata API webinar
"Has knowledge brought justice"? A survivor's perspective.
Ensayo del tema Investigación
Unit 14 LO1
Graded Care Profile
Unit 13 LO2
Forester v1.0
Taller de Tesis I, Tesis, Elaboración, Disertación, Bolivie, Bioética, Piel B...
Educación Productiva, Educación, Intercultural, Pluricultural, Bolivia, Gorge...
Listening to Mum
Towards more child-centred investigations Part 1
What is effective communication in child protection social work? Developing a...
Brain Behind, Body Forward
Warehouse
2016 коллективный договор оцбс
School and domestic violence in interaction: Russian experience
The other Kinship Carers
All About Mobile App Remarketing
Ad

Similar to Metadata API (20)

PDF
Best practices in using Salesforce Metadata API
PPTX
Play with force.com metadata
PDF
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
PPTX
SFDC Inbound Integrations
PPTX
February 2020 Salesforce API Review
PPTX
Deep Dive into Salesforce Integrations: Mapping Engines
PDF
Beyond Custom Metadata Types
PPTX
Deep Dive into Salesforce APIs
PPTX
Using the Tooling API to Generate Apex SOAP Web Service Clients
PDF
Dave Carroll Application Services Salesforce
PPT
Custom Metadata Records Deployment From Apex Code
PDF
Application Services On The Web Sales Forcecom
PDF
ISV Monthly Tech Enablement (May 18, 2017)
PPTX
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
PPTX
The tooling Api demystified, It is not only for developers, Doria Hamelryk & ...
PDF
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
PDF
Custom Metadata Types
PPTX
OData: A Standard API for Data Access
PDF
Enterprise API New Features and Roadmap
PPT
Data Management and Migration in Salesforce
Best practices in using Salesforce Metadata API
Play with force.com metadata
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
SFDC Inbound Integrations
February 2020 Salesforce API Review
Deep Dive into Salesforce Integrations: Mapping Engines
Beyond Custom Metadata Types
Deep Dive into Salesforce APIs
Using the Tooling API to Generate Apex SOAP Web Service Clients
Dave Carroll Application Services Salesforce
Custom Metadata Records Deployment From Apex Code
Application Services On The Web Sales Forcecom
ISV Monthly Tech Enablement (May 18, 2017)
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
The tooling Api demystified, It is not only for developers, Doria Hamelryk & ...
Use Custom Metadata Types for Easy ALM & Compliance for Your Custom Apps
Custom Metadata Types
OData: A Standard API for Data Access
Enterprise API New Features and Roadmap
Data Management and Migration in Salesforce

More from Cloud Analogy (20)

PPTX
Zendesk Integration With Salesforce .pptx
PPTX
Salesforce Integration With Mailchimp (1).pptx
PPTX
Top Salesforce Integrations For Businesses In 2022
PPTX
Top 5 Zoho Products And Their Features.pptx
PPTX
SAP vs Oracle: Which ERP System Should You Choose In 2022?
PPTX
5 Low-Code Tools To Increase Salesforce Admins Productivity
PPTX
Tips To Make The Most Out Of Salesforce CRM
PPTX
5 Tips For Salesforce Admin In 2022
PPTX
Trailhead Badges To Earn In 2022
PPTX
HubSpot And Slack Integration
PPTX
Multi-Factor Authentication In Salesforce
PPTX
5 Myths About Salesforce CRM
PDF
6 Sales Promotion Tips For Marketing Success
PDF
How Marketing Cloud Latest Features Can Improve Your Campaign Performance
PDF
Important Salesforce Trends to Watch Out for in 2022
PDF
How To Build Your Sales Career In The Salesforce Ecosystem
PDF
Best Sales Metrics Every Sales Leader Should Know
PDF
Common Salesforce CPQ Implementation Challenges
PDF
5 Accurate Sales Forecasting Strategies To Predict Your Revenue
PDF
How To Utilize Slack As A Secret Weapon For Your Sales Team
Zendesk Integration With Salesforce .pptx
Salesforce Integration With Mailchimp (1).pptx
Top Salesforce Integrations For Businesses In 2022
Top 5 Zoho Products And Their Features.pptx
SAP vs Oracle: Which ERP System Should You Choose In 2022?
5 Low-Code Tools To Increase Salesforce Admins Productivity
Tips To Make The Most Out Of Salesforce CRM
5 Tips For Salesforce Admin In 2022
Trailhead Badges To Earn In 2022
HubSpot And Slack Integration
Multi-Factor Authentication In Salesforce
5 Myths About Salesforce CRM
6 Sales Promotion Tips For Marketing Success
How Marketing Cloud Latest Features Can Improve Your Campaign Performance
Important Salesforce Trends to Watch Out for in 2022
How To Build Your Sales Career In The Salesforce Ecosystem
Best Sales Metrics Every Sales Leader Should Know
Common Salesforce CPQ Implementation Challenges
5 Accurate Sales Forecasting Strategies To Predict Your Revenue
How To Utilize Slack As A Secret Weapon For Your Sales Team

Recently uploaded (20)

PPTX
Benefits of Physical activity for teenagers.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Tartificialntelligence_presentation.pptx
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
DOCX
search engine optimization ppt fir known well about this
PPT
Geologic Time for studying geology for geologist
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
Benefits of Physical activity for teenagers.pptx
WOOl fibre morphology and structure.pdf for textiles
Developing a website for English-speaking practice to English as a foreign la...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Getting Started with Data Integration: FME Form 101
Tartificialntelligence_presentation.pptx
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
search engine optimization ppt fir known well about this
Geologic Time for studying geology for geologist
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
sustainability-14-14877-v2.pddhzftheheeeee
Final SEM Unit 1 for mit wpu at pune .pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Zenith AI: Advanced Artificial Intelligence
Univ-Connecticut-ChatGPT-Presentaion.pdf
Chapter 5: Probability Theory and Statistics
Web Crawler for Trend Tracking Gen Z Insights.pptx

Metadata API

  • 2. www.cloudanalogy.com First you need to understand data. What is data in context with Salesforce. Data is anything which is stored in a database like records related to Contacts, Accounts, Leads Opportunity etc. Metadata: Metadata can be defined as the set of data about another data. i.e., Configuration/Code/Logic of the underlying structure which is used to store the data (Records). Another definition is you can say the database structure in which you will be saving the data. MetaData API
  • 3. Metadata Api for Salesforce can do several things programmatically.You can read, create, update, delete following components in a Salesforce organization. 1. Custom Objects/Fields. 2. Visualforce pages. 3. Page Layouts. 4. Validation rules. 5. Apex. 6. Workflows. 7. Approval processes. 8. Profiles. 9. Reports etc. 10. Security. www.cloudanalogy.com MetaData API
  • 4. You can configure a Salesforce organization just by running a piece of code. In contrast to this I meant to say that you can create Objects,Fields,Validation,Workflows, Profiles, Reports for a particular client organization just by running the piece of code so that you need not do all the customisation settings manually which will consume time if you have to do that several times for different clients for the same configuration settings. You can also take the backup of your organization customisation settings just by fetching the metadata WSDL from your Salesforce org. For this You need to click setup>type API-Click on API >Click Generate metadata WSDL and download the xml file. www.cloudanalogy.com MetaData API
  • 5. There are two types of Metadata API calls: 1. Synchronous:- This will give the result immediately as soon as you call a method. 2. Asynchronous:- This will not give result immediately, it will take time. Asynchronous : There are four types of methods which we can use: 1. Create(); 2. Update(); 3. Upsert(); 4. Delete(); www.cloudanalogy.com MetaData API
  • 6. Synchronous : There are four types of methods which we can use: createMetadata(); saveResult[] = metadataConnection.createMetadata(Metadata[] metadata); readMetadata();readResult=metadataConnection.readMetadata(stringmetadataType,string[] fullNames); updateMetadata(); saveResult[] = metadataConnection.updateMetadata(Metadata[] metadata); upsertMetadata(); upsertResult[] = metadataConnection.upsertMetadata(Metadata[] metadata); deleteMetadata(); seleteResult[] = metadataConnection.delete(string metadataType, string[] fullNames); All these classes saveResult,readResult, upsertResult,deleteResult comes from a main class that is MetadataService.cls in which all the relevant methods are present to function Read, Create, Update, Upsert or Delete properly. www.cloudanalogy.com MetaData API
  • 7. MetadataService is a class which have several methods and used in these methods. So now if you want to create the object then you just have to call this method like this: YourClassName.createObject(); Firstly you have to deploy these classes in your org. check this link for all the classes in metadata sample and add them to your org If you face some problem like : Remote site settings error. Then just create a remote site setting in your org by typing remote site settings in setup and in Remote site URL paste the link and click save. As you call this method like for example in the Execute Anonymous section then it will create an object named as Test. www.cloudanalogy.com MetaData API
  • 8. To Create a Custom Object: You need to add this code to your class which you are using and call this method via class name to create the object. www.cloudanalogy.com MetaData API
  • 9. To Upsert a Custom Object: www.cloudanalogy.com MetaData API
  • 10. To Create a Custom Field: www.cloudanalogy.com MetaData API
  • 11. To Delete the Custom field: www.cloudanalogy.com MetaData API
  • 12. To Update the Field: www.cloudanalogy.com MetaData API
  • 13. To Update Field Level Security: www.cloudanalogy.com MetaData API
  • 14. To Create a Page: www.cloudanalogy.com MetaData API
  • 15. Sample Custom Code: For creation of a Visualforce page. www.cloudanalogy.com MetaData API
  • 17. For Deleting the Created Visualforce page: www.cloudanalogy.com MetaData API
  • 18. Ajay Dubedi Salesforce Expert www.cloudanalogy.com +1 (415) 830-3899 hello@cloudanalogy.com ajay.dubedi