Andy in the Cloud

From BBC Basic to Force.com and beyond…

15 thoughts on “Be One with the Platform through Custom Metadata

  1. Pingback: Custom Metadata, Custom UI’s, Packaging and Change Sets | Andy in the Cloud

  2. Pingback: Declarative Lookup Rollup Summary Tool and Custom Metadata | Andy in the Cloud

  3. JMoSFDC's avatar

    Hi,
    I am trying to create records in a Custom MetaDataType using https://github.com/financialforcedev/apex-mdapi. But when I create a list to use a method CustomMetadataService.createMetadata I get an error Compile Error: Field is not writeable: NAMESPACE__TestRetention__mdt.DeveloperName at line 53

    Here is my code
    List newList = new List();
    for(NAMESPACE__TestRetention__mdt s: newList)
    {
    s.developername=’New’;
    s.label=’New’;
    s.masterlabel=’New’;
    s.qualifiedapiname=’New’;
    newList.add(s);
    }
    CustomMetadataService.createMetadata(newlist);

    How do I create data for inserting it into the method if I cant insert it to a list? Can you help?

  4. Pingback: How to leverage custom metadata types - FinancialForce blog

  5. Jeremy Leiser's avatar

    Hi Andy,

    This code is awesome! Thanks for the write-up.

    I tried moving your MetadataService and CustomMetadataService files into my sandbox but hit the 3M character limit (those two files themselves are over 1M characters). Will I still hit this limit if I deploy directly from GitHub to sandbox?

    Thanks for your help,
    Jeremy

    • Andrew Fawcett's avatar

      Thank you! Sadly yes same process under the hood. It’s possible to breakdown the metadataservice but tedious, maybe better to selectively copy as you need bits

  6. Pingback: Building Robust Dynamic Code with Custom Metadata Field Relationships | Andy in the Cloud

Leave a reply to Andrew Fawcett Cancel reply