Andy in the Cloud

From BBC Basic to and beyond…

240 thoughts on “Introduction to calling the Metadata API from Apex

  1. How to write test class for this.

  2. Pingback: Update picklist value and add it in record type using apex – SFDC Parrot

  3. Pingback: Update picklist value and add it in record type using apex – SFDCians

  4. Hello Andrew,

    Basically, I wanted to copy all profile settings from one profile to another profile.
    Is this possible using Metadata API? If not then can you inform me which profile settings can be accessed?

    I have tried updating Profile tabVisibility using metadata API, it works as expected. (Sometimes I get Read timed out error.)

    When I am trying to update fullName and userLicense of the profile, I got “System.CalloutException: IO Exception: Read timed out”. Not able to do this update.
    Do you have any idea about this?
    I have raised the issue regarding this in git as well –

  5. Hi Andrew

    I am using Metadataservice class in my SandboxPostCopy Class to modify custom settings and custom labels but as it is executed by automated process it is throwing exception”INVALID_SESSION_ID” while executing this class after Sandbox refresh. Is there any workaround for this?

  6. Hi Andrew Fawcett, Do you have any example of updating the List view filter values? I have a requirement to dynamically update the list view filter’s value for an object. Thanks!

  7. Hi Andrew! Can I grab tab visibility for Profile (i.e. System Administrator) via mdapi? And do you know other ways for getting tabs visibility in clean Apex? Thanks!

  8. hello sir how to create trigger using matadata api

  9. Hi Andrew, I was wondering if we can deploy the apex class? If yes, can you share any of the example please? Thanks

    • Yes you can – search for “GitHub dlrs” and find a repo with a RollupController class in it – that is a good example. You have to be very very explicit to your users that your solution is doing this please – permissions are needed to the running user to allow this – but you still have to be upfront what you are deploying. The example I share is a good example of this.

Leave a Reply to Andrew Fawcett Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s