![]() Create a field with the same name as that of the API name of the lookup field which relates Junction_Child_c to Parent_Two_c.Create a field with the same name as that of the API name of the lookup field which relates Junction_Child_c to Parent_One_c.Create a new schema either using the headers of CSV file which contains API names of fields of Junction_Child_c object for which mock data is to be generated or manually with following steps:.List of schemas available in a mockaroo account NOTE: For field names in schema, we must use the same name as that of the API name of fields of objects in Salesforce. (We can import schema details such as name of fields and data types using csv headers or JSON to prevent human error) Any external data type name isn’t recognized. Mockaroo has it’s own set of data types (141 currently) which is needed while creating fields for the schema. Go to Mockaroo account and create 2 separate schemas (each for objects Parent One and Parent Two) under the ‘Schemas’ tab.In this example, API names of the lookup fields on ‘Junction Child’ object are Parent_One_c and Parent_Two_c. Create another custom object in Salesforce ( Junction Child) which should act as a junction object between previously created objects i.e.(In this example, Parent One and Parent Two) Once ‘mockaroo’ account has been set up, login to your Salesforce Org and create 2 custom objects. ![]() To know the API key, go to Account page after logging in to Mockaroo. This key will be used in all the API calls made to mockaroo from Salesforce org. Once done, an API key will get generated for your account. Using the link shown above, register on ‘Mockaroo’.Prerequisites:Īll set! Lets jump into the steps to get it done: In the example explained in this document, bulk data will be generated for 2 objects and then the same will be done for a junction object which has the previous 2 objects as parent. however, if same kind of data is to be generated several times, then, we can also have a class written and call it whenever required. The best part being one can execute it using the ‘Anonymous code window’ of Developer console which means your Org is clean as there is no trace to how the data got generated. So, it was then while searching net, I got to know about ‘Mockaroo’ which proved to be a hassle free way to generate test data as and when required using REST API callouts. Recently, while working on a project I came across a need to generate data in bulk to be inserted into Objects for testing purpose.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |