Creating Custom Metadata Type to Set a Limit to Not Load Data on Initial Load in e2a Address Lookup when Number of Records Exceed the Set Limit
Introduction
From e2a v3.4942 onwards, e2a has an enhancement to cater to some rare scenarios where the presence of an extremely large number of records (Leads/Contacts) in an org can lead to quite longer loading times and can cause bad user experience. With this enhancement, now users can set a record limit and if the number of respective addresses in the org is greater than the set limit value, then e2a Address Lookup will not load records and will show an information message. To do so, users will have to create a custom metadata type in the org, which will then be used by e2a to stop loading records at initial load in e2a Address Lookup. However, users can always the search and filters in e2a Address Lookup to search for any address (Leads/Contact).
Instructions
Here are the instructions to create the custom metadata type:
- Go to 'Setup' and type 'Custom Metadata Type' in the quick find box
- From the results, open 'Custom Metadata Type'
- Press on 'New Custom Metadata Type' to create a new Custom Metadata Types
- Set the Label as: e2a Customer Settings
- Set the Object Name as: e2a_Customer_Settings__mdt (note the "__mdt" gets added automatically)
- Set the Description as: This Custom Metadata type holds records related to adding a max threshold for the records that you want to show on load and if the total number of records exceeds that limit then e2a won't show any data on load and show a message to user that due to large volume of data we won't be able to show it all and try using the filters to narrow the results so that we don't hit Query timeout error.
Note: If the custom metadata type with label 'e2a Customer Settings' already exists, then the above steps can be skipped, and you can directly move to the below-mentioned steps.
You have created a Custom Metadata type now. Please follow the steps below to create a field under it:
- In the same Custom Metadata Type record, look for the 'Custom fields' section and press on 'New'
- Select Type: Text (255)
- Enter Label as: Value
- Enter API Name as: Value__c
- Add in Help: Add the value in a name/value pair, using the Label field of the record for the name
Next, user will have to create two records under the newly created metadata type. Please follow the steps to create the required records:
- Go to 'Setup' and type 'Custom Metadata Type' in the quick find box
- Open the 'Custom Metadata Types' from the result and look for the newly created metadata type i.e. e2a Customer Settings
- Press on 'Manage Records' - an option residing on the left side of the metadata type
- Press on 'New'
- Enter the Name as: Max_Records_Limit_On_Address_Lookup_Load
- Enter the Label as: Max_Records_Limit_On_Address_Lookup_Load
- Enter the Value as: any number of your choice as per your org data volume (Default Threshold Limit already set in e2a = 250000)
You have successfully created a Custom Metadata type.
Note: Neither the Custom Metadata Type nor records will be shipped as part of the package. The user can create the Custom Metadata Type (using details above) and add records of this type for specific settings, should they wish to override the hardcoded defaults. Furthermore, if you have already got a Custom Metadata Type for some other e2a soft setting in your org, then you will only need to create a record under Managed Records for Max_Records_Limit_On_Address_Lookup_Load.
Please contact us at support@ortooapps.com for any other queries.
★★★★★ - EXCELLENT
★★★★☆ - GOOD
★★★☆☆ - OK
★★☆☆☆ - POOR
★☆☆☆☆ - RUBBISH