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:

  • orders__Order__c

  • orders__Delivery__c

  • orders__OrderLineItem__c

  • orders__DeliveryLineItem__c

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:

  • v1

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
  • $.quantity

  • $.listPrice

  • orders__CatalogId__c

  • orders__CatalogLineItemId__c

  • orders__FreebieConditionId__c

  • orders__FreebieLevelId__c

  • orders__FreebieTypeId__c

  • orders__OrderId__c

  • orders__ParentId__c

  • orders__PriceBookId__c

  • orders__PriceBookLineItemId__c

  • orders__ProductComponentId__c

  • orders__PromotionId__c

  • orders__PromotionLineItemId__c

  • Lookup(Product)

  • $.quantity

  • $.listPrice

  • orders__DeliveryId__c

  • orders__OrderLineItemId__c

  • Lookup(Product)

  • orders__AccountId__c

  • orders__PriceBookId__c

  • orders__PricingProcedureId__c

  • orders__SalesOrganizationId__c

  • orders__OrderType__c

  • orders__Stage__c

  • Lookup(RetailStore)

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"
    }
}
``