Using Custom Objects Through APIs
Digital Commerce generic APIs support custom objects by replacing the :custom_object__c with the custom object API name into the URL path as shown in the example below:
[GET] .../apexrest/Apttus_WebStore/apttus/v3/:custom_object__c
[POST] .../apexrest/Apttus_WebStore/apttus/v3/:custom_object__c /query
You need to ensure that the SDK utilizes these APIs for custom services and models by following the steps below:
- Create a custom object in Salesforce and add some custom fields.
- The custom object must have at least one lookup to another object.
- The other object must have a lookup to this custom object as a child object. You can just enable attachments for this object.
- Open a template and install the latest SDK libraries.
- Create a service and model for the custom object created in step 1.
- Verify that all the methods within the service work:
- query
- where
- search
- aggregate
- describe
- get
- fetch
- delete
- create
- update
- upsert
- Verify that relationships work on the model.
- The lookup you created in step 1 should be pulled.
- The model should be able to pull the child object with attachments.