function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chaudhary AdityaChaudhary Aditya 

Unable to complete Trailhead Challenge

Hi all, 
I am trying to complete below challenge and getting an error. I have copied all details(Challange Link, Code and Error).  

Appreciate your help!


public class MetadataExample {
    public  Metadata.CustomMetadata customMetadata{get;set;}
    public void updateMetadata(){
        customMetadata  = new Metadata.CustomMetadata();
        customMetadata.fullName  = 
        Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue();
        customField.field = 'customField__c ';
        customField.value = 'New Value';
        Metadata.DeployContainer deployContainer = new Metadata.DeployContainer();
        Id asyncResultId  = Metadata.Operations.enqueueDeployment(deployContainer, null);


AbhinavAbhinav (Salesforce Developers) 
Hi Aditya,

Please note that Questions about how to pass Trailhead challenges are not on topic, because these challenges are intended to be independent demonstrations of your abilities.Trailhead Help ( provide assistance for situations where Trailhead does not appear to be functioning correctly. You can reach out to them if this is the case.

Chaudhary AdityaChaudhary Aditya
Hi Abhinav, 

May be I worded it incorrect.. I am not looking for a solution. If you look at the problem - the error message is very obvious. 

I am trying to figure out if it could be a Trailhead issue and if others have faced the issue. 

ash rodash rod
If you are planning to buy a water purifier for your home, then the first thing you need to know is the quality of the water supply in the house. Check this for more details.
Suraj Tripathi 47Suraj Tripathi 47
Please share your error Here.
maybe it should not be String and here you use this as a String Value :
customField.field = 'customField__c ';
make sure the value dataType and put that type value only.

if you have any query please comment.
If you find your Solution then mark this as the best answer to close this question. 

Thank you!
Suraj Tripathi