This document will articulate the solution design of a restful interface that allows front facing applications create & retrieve worker records from a salesforce custom object [API Name: worker__c].
- Worker App will enable a user to mention the hobby of a worker while creating a record in a custom object in Salesforce .
- Worker App will display the list of workers by retrieving the data from a custom object in Salesforce.
- Worker API will provide an interface to create, retrieve and delete worker records in the worker custom object in salesforce.
Salesforce – Object Manager
- Create a custom object [worker] in Salesforce with field as hobby.
- Use Salesforce UI to add a worker-1 with hobby as ‘Jogging’.
- Develop RAML spec using API Designer that will have a worker as a top level resource with GET method to retrieve the worker, POST method to create workers and DELETE method to delete the workers.
- Implement the API by using Salesforce connector and use query operation to retrieve a worker record and create operation to insert a worker record into the custom object.
- Implement the DELETE method by querying the workers records with the name and use the retrieved Ids and delete operation to delete the worker records from the custom object.
Salesforce Lightning Worker App
- Salesforce Platform provides Lightning App Builder which allows developers to build a lightning app on a custom object & also use lightning components.
- Setup initial Data using WorkerApp with worker name as Worker-1 and example hobby like Jogging.
- WorkerApp will show Worker-1 in the list view.
- Add 2 workers using the POST Method of Worker API.
- A new record should be created for each worker in the custom object and ID value should be returned in the response.
- WorkerApp will show both the workers [John Doe, Jane Doe] in the worker-app list view in Salesforce.
- Delete 2 workers using the DELETE Method of Worker API.
- Worker records for both the workers [John Doe, Jane Doe] specified in the request payload should be deleted from the custom object.
- WorkerApp will list the initial setup worker of [worker-1] in the worker-app list view in Salesforce.