JSON examples for the Contract copy directive
  • 16 Mar 2023
  • 3 Minutes to read
  • Dark
    Light

JSON examples for the Contract copy directive

  • Dark
    Light

Article summary

JSON example with a single IQA configuration

In this example, the goal is to copy the Contract line items and sublines, and also the peer-related (to Contract) object zpl_TierIncentive_c, which has a lookup relationship to Contract.

  • objectsToInclude—​Sublines to copy into the new deal.

  • fieldsToExclude—​Fields to exclude from copying into the new deal.

  • fieldDefaults—​Default fields with static values.

    You can configure default fields of type Date, DateTime, and Checkbox.

    For the full list of supported fields, refer to Supported field data types.

    Example of the "fieldDefaults" configuration in Copy Directive:

         "fieldDefaults": {
                "Date__c": "2022-08-11",
                "DateTime__c": "2022-08-11 01:22:22",
                "Checkbox": "true"
                }
    
    • You can map a source agreement/quote field to a target agreement/quote field in the copied agreement/quote.

      For each field you want to create a custom mapping for, you must add a separate name/value pair under the fieldDefaults node. The first part of the pair is the field you want to map the data to (the target). The second is either:

      • the source field (designated by the prefix "$Source.")
      • a static string.
      Important

      There are several limitations to observe when configuring the field mapping:

      • If mapping from a source field to a target field, both source and target fields must already exist. If either field does not exist, the user will get an error message, and the copy will not be successful.
      • If the source is a static string, the target field must be of a Text (String) type. Otherwise, the user will get an error message, and the copy will not be successful.
      • If both fields are valid, but of conflicting types (for example, text vs. numeric values), the user will get an error message, and the copy will not be successful.
  • iQAConfiguration—​(optional) specify the Configuration name of an existing IQA Configuration. Leave this value empty if you don't want to apply an IQA Configuration to the line items in the copied version.

Example of the IQA configuration
{
   "source":"Contract",
   "sourceReferenceField":"zpl__SourceContract__c",
   "fieldsToExclude":[
      "zpl__ContractId__c",
      "zpl__ParentContract__c",
      "CustomerSignedDate",
      "CustomerSignedId",
      "CustomerSignedTitle"
   ],
   "fieldDefaults": {"Status": "Draft"},
   "iQAConfiguration":"",
   "objectsToInclude":[
      {
         "source":"zpl__ContractLineItem__c",
         "lookupField":"zpl__Contract__c",
         "iQAConfiguration":"",
         "fieldsToExclude":[
            "zpl__EffectiveDate__c",
            "zpl__Error__c",
            "zpl__Contract__c",
            "zpl__ParentContractLineItem__c",
            "zpl__Status__c"
         ],
         "objectsToInclude":[
            {
               "source":"zpl__ContractSubline__c",
               "lookupField":"zpl__ContractLineItem__c",
               "fieldsToExclude":[
                  "zpl__ContractLineItem__c",
                  "zpl__ContractSublineId__c"
               ],
               "objectsToInclude":[
        	   ]
            }
         ]
      },
      {
         "source": "zpl__TierIncentive__c",
         "fieldsToExclude": [
         
         ],
         "lookupField": "zpl__Contract__c",
         "objectsToInclude": [
         
         ]
      }
   ]
} 

JSON example with multiple IQA configurations

In this example, the goal is to copy the Contract line items and sublines.
You must use the iQAConfigurations property instead of iQAConfiguration.

"iQAConfigurations":[
   {
      "name":"testIQAConfiguration1",
      "filterFieldName":"zpl__testFilter1__c"
   },
   {
      "name":"testIQAConfiguration2",
      "filterFieldName":"zpl__testFilter2__c"
   }
],

Here the filterFieldName value is the name of the checkbox field on the object that will be processed by IQA call once this field evaluates to TRUE.

  • iQAConfigurations—​(optional) specify the names of the Configurationof existing IQA Configurations. Leave this value empty if you don't want to apply any IQA Configuration to the line items in the copied version.

    • name—​specify the Configuration name of an existing IQA Configuration.

    • filterFieldName—​(optional) specify the name of the checkbox field, created on the target object, to filter which lines should be processed by the IQA Configuration. The line will be processed by the configuration only when the checkbox field evaluates as TRUE.

    • batchSize—​(optional) you can specify the needed value or remove this record at all. In that case the default value 35 will be applied.

      Important
      • IQA Configurations are applied to lines in the order in which they are specified in the Copy Directive.
      • You MUST use either iQAConfiguration or iQAConfigurations.
    Example of the IQA configurations
    {
       "source":"Contract",
       "sourceReferenceField":"zpl__SourceContract__c",
       "externalIdField":"zpl__ExternalId__c",
       "externalBulkDataJobIdField":"zpl__ExternalBulkDataJobId__c",
       "fieldsToExclude":[
          "zpl__ContractId__c",
          "zpl__ExternalId__c",
          "zpl__ExternalBulkDataJobId__c",
          "zpl__ParentContract__c",
          "CustomerSignedDate",
          "CustomerSignedId",
          "CustomerSignedTitle"
       ],
       "fieldDefaults":{
          "Status":"Draft"
       },
       "objectsToInclude":[
          {
             "source":"zpl__ContractLineItem__c",
             "lookupField":"zpl__Contract__c",
             "externalIdField":"zpl__ExternalId__c",
             "externalBulkDataJobIdField":"zpl__ExternalBulkDataJobId__c",
             "iQAConfigurations":[
                {
                   "name":"testIQAConfiguration1",
                   "filterFieldName":"zpl__testFilter1__c",
                   "batchSize":"20"
                },
                {
                   "name":"testIQAConfiguration2",
                   "filterFieldName":"zpl__testFilter2__c",
                   "batchSize":"15"
                },
             ],
             "fieldsToExclude":[
                "zpl__ExternalId__c",
                "zpl__ExternalBulkDataJobId__c",
                "zpl__EffectiveDate__c",
                "zpl__Error__c",
                "zpl__Contract__c",
                "zpl__ContractLineItemId__c",
                "zpl__ParentContractLineItem__c",
                "zpl__Status__c"
             ],
             "objectsToInclude":[
                {
                   "source":"zpl__ContractSubline__c",
                   "lookupField":"zpl__ContractLineItem__c",
                   "externalIdField":"zpl__ExternalId__c",
                   "externalBulkDataJobIdField":"zpl__ExternalBulkDataJobId__c",
                   "fieldsToExclude":[
                      "zpl__ExternalId__c",
                      "zpl__ExternalBulkDataJobId__c",
                      "zpl__ContractLineItem__c",
                      "zpl__ContractSublineId__c"
                   ],
                   "iQAConfigurations":[
                      {
                         "name":"testIQAConfigurationForSubline",
                         "filterFieldName":"zpl__testFilter__c",
                         "batchSize":"15"
                      }
                   ],
                   "objectsToInclude":[
                   ]
                }
             ]
          }
       ]
    }
    
    

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.