The SDK Step
The SDK step is used to execute a custom project logic that is implemented via the Apex class. It allows you to perform additional operations and overwrite some fields on the objects that participate in the price calculation.
-
To perform the SDK step, tap the button in the CT Mobile app to initialize the calculator instead of using the standard calculation logic.
A custom logic must be specified in both Salesforce and CT Mobile to prevent different price calculation results. -
Although several SDK steps can be used, we recommend only one step of this type in order to reduce the calculation time.
Step Keys
| Key | Type | Required | Comment |
|---|---|---|---|
type |
String |
Yes |
It is filled out with the sdk constant. |
fieldsAllowedToChange |
An array of fields allowed to change |
Yes |
An array may contain zero or more items. An array may contain only one item for the objectName key. See the Fields Allowed to Change. |
salesforceSDK |
SDK |
No |
If the key is not used in the price calculation on the Salesforce side, the different price calculation results will be received in Salesforce and CT Mobile. See the SDK. |
ctMobileSDK |
SDK |
No |
If the key is not used in the price calculation In the CT Mobile app, the different price calculation results will be received in Salesforce and CT Mobile. See the SDK. |
Fields Allowed to Change
| Key | Type | Required | Comment |
|---|---|---|---|
objectName |
Enum |
Yes |
The API name of the object. Available values:
|
fields |
Array of Strings |
Yes |
the objectName key is allowed to be changed via the custom logic. Specify the fields that should be overwritten with new values by the custom Apex class.
|
SDK
| Key | Type | Required | Comment |
|---|---|---|---|
version |
Enum |
Yes |
SDK version. Available values:
|
implementation |
String |
Yes |
SDK implementation class name |
Restricted Fields
| These fields are populated by the system during the ordering process and cannot be overwritten by the custom logic. |
| Order Line Item | Delivery Line Item | Order | Delivery |
|---|---|---|---|
|
|
|
|
Example
SDK Step:
Click to view
{
"type": "sdk",
"fieldsAllowedToChange": [
{
"objectName": "orders__DeliveryLineItem__c",
"fields": [
"$.unitPrice"
]
}
],
"salesforceSDK": {
"version": "v1",
"implementation": "OrderImplementation.SetUnitPriceAsListPrice"
},
"ctMobileSDK": {
"version": "v1",
"implementation": "OrderImplementation.SetUnitPriceAsListPrice"
}
}