In this article, we will see the solutions to Module: Apex Metadata API.
#1.Get Started with Apex Metadata API
Q1)You’ve developed a new feature that includes several new custom metadata types. Your admins need to install and configure your feature in multiple orgs. How can you ease the work for your admins?
I)Write an Apex post-install script that makes the metadata updates.
II)Write careful instructions on how to make the necessary changes in Setup.
III)Create a custom setup wizard to simplify the configuration.
IV)Send them a lovely fruit basket.
V)A and C (and D couldn’t hurt)
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
V)A and C (and D couldn’t hurt)
[/bg_collapse]
Q2)Apex Metadata API works with which of the following metadata types?
I)All metadata types
II)Page layouts and records of custom metadata types
III)Page layouts and list views
IV)Custom metadata types
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
II)Page layouts and records of custom metadata types
[/bg_collapse]
Q3)Which of the following is not supported by Apex Metadata API?
I)Creating metadata
II)Reading metadata
III)Updating metadata
IV)Deleting metadata
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
IV)Deleting metadata
[/bg_collapse]
#2.Build Automated Metadata Updates for Multi-Org Deployment
Click on the video to get the solution to Build Automated Metadata Updates for Multi-Org Deployment
#3.Build Admin Tools for Automated Configuration Changes
Click on the video to get the solution to Build Admin Tools for Automated Configuration Changes
#4.Test Your Metadata Deployment
Q1)Which of the following can you test?
I)The state of the org after you’ve deployed metadata into it
II)The structure of the deployment container
III)The behavior of your callback
IV)A and C
V)B and C
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
V)B and C
[/bg_collapse]
Q2)How should you test a metadata deployment request?
I)Exercise your code to build a deployment request, and verify its structure.
II)Exercise your code to build a deployment request, and enqueue the deployment.
III)Add assert statements to your callback.
IV)All of the above.
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
I)Exercise your code to build a deployment request, and verify its structure.
[/bg_collapse]
Q3)Apex Metadata API relies on asynchronous deployment. What implications does this have?
I)You can use it to toggle features on and off for unit testing.
II)You can test callbacks by executing the deployment and waiting for the callback.
III)You must test callbacks directly, outside of the deployment process.
IV)You can rely on operations happening in order.
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
III)You must test callbacks directly, outside of the deployment process.
[/bg_collapse]
#5.Understand Apex Metadata API and Security
Q1)When a managed package uses Apex Metadata API to create metadata records in a subscriber org, which namespace is the metadata created in?
I)Not sure, I skipped to the quiz.
II)The namespace of the managed package.
III)The namespace of the subscriber org.
IV)A new namespace that you designate.
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
III)The namespace of the subscriber org.
[/bg_collapse]
Q2)Apex Metadata API allows managed packages to create which of the following elements?
I)Apex classes
II)Visualforce pages
III)Automatic code generators
IV)Page layouts
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
IV)Page layouts
[/bg_collapse]
Q3)Enabling the Deploy Metadata Apex setting allows which kind of packages to make changes in an org?
I)Certified managed packages
II)Uncertified managed packages
III)Unmanaged packages
IV)Packages containing permission sets
[bg_collapse view=”button-orange” color=”#4a4949″ expand_text=”Show Answers” collapse_text=”Close Answer” ]
II)Uncertified managed packages
[/bg_collapse]
For more information you can visit Apex Metadata API | Salesforce Trailhead