Customer

This component runs the Customers (CUS) function.

Note: 
  • This Help contains hyperlinks that are enabled when the Help is accessed within the application. However, if you have accessed this Help via the SunSystems Web portal, hyperlinks are not enabled.
  • The Customer Items section of the payload is for use with the Query method only. Customer Item data is maintained via the ItemCustomer component.

Methods

Note: In a Financials Only business unit, the fields DefaultCarrier, DefaultDispatchWarehouse, DefaultReturnLocation, DefaultSalesDefinitionCode, DefaultSalesperson and PrimaryDeliveryAddress are not applicable. Therefore, payload values for these fields will not be applied when using the Amend, BulkCreateOrAmend, Create and CreateOrAmend methods.
Amend
Driver Type: SASI
Use this method to amend one or more customers. If a customer does not exist, an error message is produced and the payload is rejected.
Note: You cannot use this method to amend the status of a Customer. Instead, use one of the Open, Hidden, SuspendedHeld or Closed methods.
BulkCreateOrAmend
Driver Type: DJI
Use this method for the bulk loading of customer data or bulk amendment of customer data, or where performance is critical.
Note: Although the SASI method accepts dates and periods with slashes, the DJI method does not and expects dates in ddmmyyyy format and periods in pppyyyy format.
You cannot use this method to amend the status of a customer. Instead, use one of the Open, Hidden, SuspendedHeld or Close methods.
Closed
Driver Type: SASI
Use this method to amend the status of one or more customers to Closed.
Create
Driver Type: SASI
Use this method to create one or more customers. If a customer already exists, an error message is produced and the payload is rejected.
CreateAsDraft
Driver Type: SASI
Use this method to create one or more draft customer records.
CreateOrAmend
Driver Type: SASI
Use this method to create or amend one or more customers. A customer is created if it does not exist and amended if it does. Both the Create and Amend methods require you to know in advance if a customer exists, whereas this method can be used if you are unsure.
Note: You cannot use this method to amend the status of a customer. Instead, use one of the Open, Hidden, SuspendedHeld or Closed methods.
CreateReplaceOrDelete
Driver Type: SASI
Use this method to synchronize customers. A customer is created if it does not exist already and replaced if it does. If the customer does not exist in the originating business unit, it is deleted.
Delete
Driver Type: SASI
Use this method to delete one or more customers.
DeleteChildData
Driver Type: SASI
Use this method to delete child data (Delivery Addresses, Invoice Addresses, Contact Addresses, Acknowledgement Addresses, Customer Document Formats) but retains the parent record (Customer).
Note: Standard Text should be deleted using the Delete method for the StandardTextLanguageVariants component.
Hidden
Driver Type: SASI
Use this method to amend the status of one or more customers to Hidden.
Open
Driver Type: SASI
Use this method to amend the status of one or more customers to Open.
Query
Driver Type: Export
Use this method to obtain customer details or to extract customer data from SunSystems.
SuspendedHeld
Driver Type: SASI
Use this method to amend the status of one or more customers to Suspended/Held.

Mandatory fields

General
  • When creating or amending a customer or changing the customer status, a value must be supplied for the Customer Code - payload element <CustomerCode>
  • When creating or amending a customer document format code, a value must be supplied for the Document Format Code - payload element <DocumentFormatCode>
  • When creating or amending customer analysis entries, a value must be supplied for the Analysis Code - payload element <VCustCatAnalysis_AnlCode>
  • When creating or amending customer account analysis entries, a value must be supplied for the Account Analysis Code - payload element <VAcntCatAnalysis_AnlCode>
  • When creating or amending customer tax entries, a value must be supplied for the Sequence Number - payload element <SequenceNumber>
Note: At runtime the component validates the payload contents to ensure that the values supplied are correct. Various combinations of values may require other elements in the payload to be specified before the payload can be processed successfully.
Customer Addresses
  • When creating or amending a customer delivery address, a value must be supplied for Delivery To Address Code - payload element <DeliveryAddressCode>.
  • When creating or amending a customer invoice address, a value must be supplied for Invoice Address Code - payload element <InvoiceAddressCode>.
  • When creating or amending a customer contact address, a value must be supplied for:
    • Contact Identifier - payload element <ContactIdentifier>
    • Contact Address Code - payload element <AddressCode>.
  • When creating a customer acknowledgement Address, a value must be supplied for Customer Acknowledgement Address Code - payload element <AddressCode>.
Deleting Child Data
  • When deleting child data, a value must be supplied for Customer Code - payload element <CustomerCode>
  • When deleting Delivery Address child data, a value must be supplied for Delivery To Address Code - payload element <DeliveryToAddress.DeliveryAddressCode>
  • When deleting Invoice Address child data, a value must be supplied for Invoice Address Code - payload element <InvoiceAddress.InvoiceAddressCode>
  • When deleting Contact Address child data, a value must be supplied for:
    • Contact Identifier - payload element <ContactAddress.ContactIdentifier>
    • Contact Address Code - payload element <ContactAddress.AddressCode>
  • When deleting Acknowledgement Address child data, a value must be supplied for Customer Acknowledgement Address Code - payload element <AcknowledgedAddress.AddressCode>
  • When deleting Customer Document Formats child data, a value must be supplied for:
    • Document Format Sales Stage - payload element <DocumentFormat.SalesStage>
    • Document Format Sales Definition Code - payload element <DocumentFormat.SalesDefinitionCode>

Related data

  • Contact Address
  • Delivery To Address
  • Invoice Address
  • Tax
  • Document Format Code
  • Acknowledged Address
  • Standard Text
  • Customer Address Analysis 1-10
  • Customer Account Analysis 1-10.

The attachment of Standard Text is supported by the Create, Amend and CreateOrAmend methods only, and not by BulkCreateOrAmend. If the standard text supplied in the payload does not exist then it is created. However, it is not possible to amend existing standard text by this means; existing standard text is attached by key only, and any non-key fields in the SSC payload are ignored. Standard text can be amended using the Standard Text Language Variants function from SunSystems or the SSC component StandardTextLanguageVariants.

The standard text to be attached is language specific and therefore must be included within the StandardTextLang part of the payload in order to be detected by the SSC component, as shown in the following example:

<AnalysisCodes>
		...
		<StandardText>
				<StandardTextLang>
						<LanguageCode>1</LanguageCode>
						<StandardTextClassCode>STD</StandardTextClassCode>
						<StandardTextCode>DELIV</StandardTextCode>
				</StandardTextLang>
		</StandardText>
</AnalysisCodes>