Showing posts with label Custom Metadata Types. Show all posts
Showing posts with label Custom Metadata Types. Show all posts

Monday, January 18, 2016

Settings and Uploading Custom metadata Records with Custom Metadata Loader in Salesforce

In my previous posts I have explained what is Custom MetaData Loader .Now I'm going to explain how to set up this tool/application in salesforce.

1. Download the Complete application Zip file from the git hub Source.

2. Deploy the Downloaded Zip file into your org using below tools
3. Once you have deployed the zip file successfully it will creates below components
  • 10 Apex Classes
  • 2  Apex Page
  • 1  Custom Application
  • 1  Custom meta data type
  • 1  Custom tab
  • 1  Permission Set
    For complete package.xml file you can refer here

4. Goto Setup-->Permission Sets-->Click on Custom Metadata loader-->Manage Assignments

5. Click on Add Assignments -->Add the users to whom you want to give access for this App.

6. Goto Application menu Select Custom Metadata Loader application.

7. Clicking on Custom Metadata Loader you will be receiving below error.

8.To resolve that error we need to create a one Remote Site Setting. On clicking on the below Create Remote Site Setting button it will automatically creates a remote site setting directly.

9. Even after clicking the button your not able to create or if your getting error like Cannot create a new component with the namespace: srinu_dev_ed. Only components in the same namespace as the organization can be created through the API it means in your org you have enabled/created some custom domain.

10.To fix this issue 

  • In Classic : copy the complete page url where your receiving this error and goto Remote Site setting and give below details and save it.          

  • In Lightning : you cannot simply copy and paste the URL to the error page on the Custom Metadata Loader tab, you will need the VisualForce URL instead. Use where _____ is your custom domain, for example  
        Remote Site Name : c_mdapi
        Remote Site URL         : Copied page URL
        Active                       : Checked

11. Now everything is finished on clicking on the Custom metadata loader you will receive the below screen.So you can start uploading the .csv file to insert the records.

The .csv file header names must be the Api names of the Custom meta data type for auto mapping the fields.

Enjoy with Custom Metadata Loader....................!

Please comment or write us if you have any queries/requirements.

Please like,follow,bookmark,subscribe this site to receive daily updates.

Hope this helps you..Enjoy..!

Friday, January 8, 2016

Custom Metadata Loader in Salesforce

In my previous posts I have explained what is Custom MetaData Types and how to Create Custom Metadata Types in Salesforce. Once everything is set up next task is to create records in those custom metadata types.If it 10 to 15 records we can create manually but there are some situations where you need to load more number of records let take an example loading the country names and their respective country codes.

To do this there is no specific tools like Data loader and Import wizard in salesforce to upload Custom Metadata type records.To achieve this we have an other option called Custom Metadata Loader.

Custom Metadata Loader

  • Custom metadata loader is a tool for creating custom metadata records from a csv file. 
  • This Custom Metadata Loader is a custom application which build on top of the salesforce with the help of Metadata API to support bulk uploads.
  • Create custom metadata types in your Salesforce org using Metadata API and then use custom metadata loader to bulk load the records.
  • It supports up to 200 records upload with a single call.

In my next post I will post How to set up and how to upload the records with this tool in salesforce. 

Keep watching the site for more updates enjoy......!

Monday, January 4, 2016

How to create a Custom Metadata Types,Fields and Records in Salesforce

In my previous post I have written about Custom Metadata Types .In this post I'm going to explain how to create a Custom Metadata Types,Fields and Records.

Creating Custom Metadata Type:

1.Goto Setup-->Develop-->Custom Metadata Types

2.Please fill all Label and Plural Label and also select the Visibility of Metadata Type

3.Looks likes below image after filing all details for Protected Custom meta datatypes and click save

4.After clicking it will be landed to Custom Meta data types details page which looks likes custom object detail page.Details page contains

  • Metadata type detail (All meta data type api names ends with  __mdt )
  • Standard Fields
  • Custom Fields (to create a user defined fields in Types)
  • Page Layouts       

Creating Fields in Custom Metadata Type:

1.To create Custom fields click on new button on Custom fields section
2.Select field type and click on next
3..Here we need to fill all details and select the field Manageability as shown below

Creating Records in Custom Metadata Type:

1. Click on manage button to create a Record as shown below

2.Fill all field values and if you want to protect this record select protected component check box

Enjoy with Custom meta data types.........!

Sunday, January 3, 2016

Custom Metadata Types in Salesforce

We can say that Custom Metadata Types are just like the List Custom Settings in Salesforce but only difference is that in Custom metadata types records are also treated as metadata(In custom settings records are treated as non metadata so you can't move custom settings records with the help of change sets) and the records,the Custom metadata types with protected feature and fields in it with manageable feature.

Custom metadata types are typically used to define application configurations that need to be migrated from one environment to another, or packaged and installed.

Usually we will be designing the apps with the help of data records in custom objects or custom settings.Now you can create custom metadata types and add metadata records,with all the manageability that comes with metadata is package,deploy,and upgrade.The most advantage is here is that querying custom metadata records doesn't count against SOQL limits.

Filed Types Supported by Custom MetadataType
  • Checkbox
  • Date
  • Date and Time
  • Email
  • Number
  • Percent
  • Phone
  • Text
  • Text Area
  • URL
Custom metadata fields and their manageability:

   The developer of the Custom Meta Data type decides who can change the field values after they ate deployed to subscriber organization.

  • Locked after release: For any record of the type, the value of the field is immutable after deployment, even on the developer organization where the record was created.
  • Subscriber editable: Anyone with the correct permissions can change the value of the field at will. Any changes the developer deploys do not overwrite values in the subscriber's organization.
  • Upgradable: The developer of a record can change the value of the field by releasing a new version of the custom metadata package. The subscriber can’t change the value of the field.
Custom metadata records with protected feature:

   If a developer releases protected records in a managed package, access to them is limited in specific ways.

  • Code that’s in the same managed package as custom metadata records can read the records.
  • Code that’s in the same managed package as custom metadata types can read the records that belong to that type.
  • Code that’s in a managed package that doesn’t contain either the type or the protected record can’t read the protected records.
  • Code that the subscriber creates and code that’s in an unmanaged package can’t read the protected records.
  • The developer can modify protected records only with a package upgrade. The subscriber can’t read or modify protected records. The developer name of a protected record can’t be changed after release.

1.A subscriber to a managed package containing a custom metadata type can’t add their own fields to that type. Only the org that develops the type can add custom fields to it.

2.If you create a protected custom metadata record in your organization, then it’s accessible only by your code, code from unmanaged packages, and code from the managed package that defines its type.

3.If you change a custom meta data type from protected to public, its protected records remain protected and all other records become public.

4.If you use Setup to create a new record on a protected type, the Protected Component checkbox is checked by default.

5.Once the custom metadata type is public, you can’t convert it to protected.

6.The subscriber can’t create records of a protected type.

For more info related this please go through this Link .

In next post I will cover how to create custom meta data types and what are the limits and limitations of Custom Metadata types.