Source ERP · 97 of 105

CRMPro → Salesforce — SouthWare: what the shipped templates set up

Read it in the terminal with "dlake skills show dlake-crmpro-salesforce/erps/southware". It extends the dlake-crmpro-salesforce skill, which holds what is true whatever the source ERP.

CRMPro → Salesforce — SouthWare: what the shipped templates set up

Keep this skill current. dlake ships updates often and this text is embedded in the CLI you have installed. Before relying on it, compare dlake --version with npm view @commercient/dlake version; if they differ, run npm install -g @commercient/dlake@latest and then dlake skills install, which overwrites the installed skill files with the current text.

dlake-crmpro is the parent skill and the authority for everything general: the crmpro_* tools, CRM_Configuration and CRM_FieldList, TimeStampRepository, the three kinds of source view, the NULL-cursor rule and the silent zero-record run. Read it first; this page does not repeat it. dlake-crmpro-salesforce is the destination skill this page is a child of, and the authority for the Salesforce conventions that hold across every ERP: read it first, then come back here for what this source’s own templates set. This page is dlake-crmpro-salesforce/erps/southware.md, and that skill’s ERP table is what points at it. What follows is only what the shipped SouthWare → Salesforce templates themselves set, read from their Insert_Query, CreateViewQuery and MappingJson. This page grows as the catalogue does.

1. What the templates deliver

GroupBusiness outcomeObjectsSource tables and views
Get Salesforce UsersThe templates push User to Salesforce. New records are created, existing ones updated, and records removed in the ERP are deleted.User
AccountIn addition to creating the Account record from your ERP customer records, Commercient syncs over the entire Accounting AR Customer record into a Commercient AR Customer object which is a Managed Custom Object (MCO). A lookup field is provided to lookup to the default AR Customer record MCO from the Account record. New records are created, existing ones updated, and records removed in the ERP are deleted.Account, CommercientSF40__RCUST__c, CommercientSF40__RSMAN__cSF_ERP_Salesforce_Clone_SWBARCUST, SF_ERP_Salesforce_Clone_SWBARSHIP, SF_ERP_Salesforce_Clone_SWBARSMAN
Customer Multi Ship AddressesIf you are using multiple ship to addresses for a given AR Customer in your ERP system then you will be able to see all the addresses inside the CRM Account screen in a Commercient Multi Ship To Address MCO related list. New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF40__RSHIP__cSF_ERP_Salesforce_Clone_SWBARSHIP
InvoiceBoth Open and Historical invoices are synchronized. Open invoice changes, such as a balance change, or a terms change are reflected in the CRM as they sync based on the frequency of the sync you have chosen (e.g. every hour for example). New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF40__SHST1__c, CommercientSF40__SHST2__c, CommercientSF40__SHST4__cSF_ERP_Salesforce_Clone_SWBASHST1, CommercientFlags, SF_ERP_Salesforce_Clone_SWBASHST2, SF_ERP_Salesforce_Clone_SHST4, SF_ERP_Salesforce_Clone_SHST1
SalesorderCommercient will sync the Sales Orders from the ERP Sales Order Entry module to the Commercient Sales Order Header (MCO) objects in CRM. In the CRM, customer service and sales people can visualize the status of the order such as on hold, backorder, forward order, scheduled for delivery, whether it has shipped, and completion status. New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF40__SBIL1__c, CommercientSF40__SBIL2__cSF_ERP_Salesforce_Clone_SWBASBIL1, CommercientFlags, SF_ERP_Salesforce_Clone_SWBASBIL2

2. The process rows the templates create

Each template’s Insert_Query writes one CRM_Configuration row. These are the values it sets; a column the inserts never set is not listed.

Display nameCRM_Object_API_NameCRM_PK_API_NameSync_OrderTimeStamp_PrefixSQL_Query targetfield prefix / postfixSync_Operation_Type
Get Salesforce UsersUserCommercientSF6__SalespersonCode__c0vw_SOUTHWARE_GetUser1=0'' / ''1
SOUTHWARE SalesPerson SyncCommercientSF40__RSMAN__cCommercientSF40__ExternalKey__c1vw_SOUTHWARE_SalesPersonvw_SOUTHWARE_SalesPersonCommercientSF40__ / __c1
SOUTHWARE Customer SyncCommercientSF40__RCUST__cCommercientSF40__ExternalKey__c3vw_SOUTHWARE_Customervw_SOUTHWARE_CustomerCommercientSF40__ / __c1
Account Reverse Lookup SyncAccountCommercientSF__Commercient_ArCustomerCode__c4vw_SOUTHWARE_AccountReverseLookupvw_SOUTHWARE_AccountReverseLookup'' / ''1
SOUTHWARE Ship To Address SyncCommercientSF40__RSHIP__cCommercientSF40__ExternalKey__c4vw_SOUTHWARE_ShipToAddressvw_SOUTHWARE_ShipToAddressCommercientSF40__ / __c1
SOUTHWARE Salesorder Header SyncCommercientSF40__SBIL1__cCommercientSF40__ExternalKey__c5vw_SOUTHWARE_SalesOrderHeadervw_SOUTHWARE_SalesOrderHeaderCommercientSF40__ / __c1
SOUTHWARE Salesorder Line SyncCommercientSF40__SBIL2__cCommercientSF40__ExternalKey__c6vw_SOUTHWARE_SalesOrderLinevw_SOUTHWARE_SalesOrderLineCommercientSF40__ / __c1
SOUTHWARE Invoice Header SyncCommercientSF40__SHST1__cCommercientSF40__ExternalKey__c7vw_SOUTHWARE_InvoiceHeadervw_SOUTHWARE_InvoiceHeaderCommercientSF40__ / __c1
SOUTHWARE Invoice Line SyncCommercientSF40__SHST2__cCommercientSF40__ExternalKey__c8vw_SOUTHWARE_InvoiceLinevw_SOUTHWARE_InvoiceLineCommercientSF40__ / __c1
SOUTHWARE Invoice Payment SyncCommercientSF40__SHST4__cCommercientSF40__ExternalKey__c9vw_SOUTHWARE_InvoicePaymentvw_SOUTHWARE_InvoicePaymentCommercientSF40__ / __c1

Every one of these inserts Is_Active as 0, so an imported process is inactive until an operator activates it. Across the set they insert Is_Create_Entity 0, Is_Create_Fields 0, Is_Active_Get_Records 0, Is_Active_Delete_Records 0, IsAccountMatching False, Sync_Batch_Size 200. Text columns a template does not use are inserted as '' rather than left NULL. Get_SOQL_Query carries a query on Get Salesforce Users — those rows read records back from Salesforce as well as pushing.

3. The views

Each template creates its view with CreateViewQuery, in the gateway dbo schema. “Change detection” names which of the three kinds dlake-crmpro defines the view’s own WHERE makes it; where a view’s shape is not one of those three the column is left empty and the view’s own WHERE is the authority.

ViewChange detectionRepository keyReads other prefixesIdentity columnSource tables
vw_SOUTHWARE_Accountinsert + updatevw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_GetUser:, vw_SOUTHWARE_Account:SF_ERP_Salesforce_Clone_SWBARCUST, SF_ERP_Salesforce_Clone_SWBARSHIP
vw_SOUTHWARE_SalesPersoninsert + updatevw_SOUTHWARE_SalesPerson:ExternalKeySF_ERP_Salesforce_Clone_SWBARSMAN
vw_SOUTHWARE_Customerinsert + updatevw_SOUTHWARE_Customer:vw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_Account:ExternalKeySF_ERP_Salesforce_Clone_SWBARCUST
vw_SOUTHWARE_AccountReverseLookupinsert + updatevw_SOUTHWARE_AccountReverseLookup:vw_SOUTHWARE_Customer:, vw_SOUTHWARE_Account:SF_ERP_Salesforce_Clone_SWBARCUST
vw_SOUTHWARE_ShipToAddressinsert + updatevw_SOUTHWARE_ShipToAddress:vw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:ExternalKeySF_ERP_Salesforce_Clone_SWBARSHIP
vw_SOUTHWARE_SalesOrderHeaderinsert + updatevw_SOUTHWARE_SalesOrderHeader:vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:ExternalKeySF_ERP_Salesforce_Clone_SWBASBIL1, CommercientFlags
vw_SOUTHWARE_SalesOrderLineinsert + updatevw_SOUTHWARE_SalesOrderLine:vw_SOUTHWARE_SalesOrderHeader:ExternalKeySF_ERP_Salesforce_Clone_SWBASBIL2
vw_SOUTHWARE_InvoiceHeaderinsert + updatevw_SOUTHWARE_InvoiceHeader:vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:ExternalKeySF_ERP_Salesforce_Clone_SWBASHST1, CommercientFlags
vw_SOUTHWARE_InvoiceLineinsert + updatevw_SOUTHWARE_InvoiceLine:vw_SOUTHWARE_InvoiceHeader:ExternalKeySF_ERP_Salesforce_Clone_SWBASHST2
vw_SOUTHWARE_InvoicePaymentinsert + updatevw_SOUTHWARE_InvoicePayment:vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:, vw_SOUTHWARE_InvoiceHeader:ExternalKeySF_ERP_Salesforce_Clone_SHST4, SF_ERP_Salesforce_Clone_SHST1

The repository key these templates build is <TimeStamp_Prefix>:<key>. The literal in the view and the TimeStamp_Prefix on the configuration row have to be the same string, case included.

4. Order of work

The templates set Sync_Order from 0 to 9. A run processes active rows in ascending Sync_Order, which is the order the templates put them in:

  • 0 — Get Salesforce Users
  • 1 — SOUTHWARE SalesPerson Sync
  • 3 — SOUTHWARE Customer Sync
  • 4 — Account Reverse Lookup Sync, SOUTHWARE Ship To Address Sync
  • 5 — SOUTHWARE Salesorder Header Sync
  • 6 — SOUTHWARE Salesorder Line Sync
  • 7 — SOUTHWARE Invoice Header Sync
  • 8 — SOUTHWARE Invoice Line Sync
  • 9 — SOUTHWARE Invoice Payment Sync

Several of these rows share a Sync_Order value: each template group carries its own numbering, so give the imported processes an order across the whole set rather than taking the template values as one.

These views read another process’s repository prefix, which is what makes the order a dependency order: the row appears in the view only once the process that writes that prefix has run, so a parent flows on one run and its children on the next.

  • vw_SOUTHWARE_Account reads vw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_GetUser:, vw_SOUTHWARE_Account:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_AccountReverseLookup reads vw_SOUTHWARE_Customer:, vw_SOUTHWARE_Account:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_Customer reads vw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_Account:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_ShipToAddress reads vw_SOUTHWARE_SalesPerson:, vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_InvoiceHeader reads vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_InvoiceLine reads vw_SOUTHWARE_InvoiceHeader:
  • vw_SOUTHWARE_InvoicePayment reads vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:, vw_SOUTHWARE_InvoiceHeader:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_SalesOrderHeader reads vw_SOUTHWARE_Account:, vw_SOUTHWARE_Customer:; no template in this set writes vw_SOUTHWARE_Account:
  • vw_SOUTHWARE_SalesOrderLine reads vw_SOUTHWARE_SalesOrderHeader:

5. Field mapping

CRM_FieldList carries one row per pushed column, with Object_Name equal to the CRM_Object_API_Name value — as dlake-crmpro puts it, an object with no CRM_FieldList rows pushes nothing and records no error. Each template carries its intended mapping in MappingJson. Read that with dlake admin crmpro_templates, then check crmpro_field_mapping on the created process before activating it.

TemplateObjectMapped fieldsFirst ERP → Salesforce pairs
Account SyncAccount15CommercientSFommercient_ArCustomerCodeCommercientSF__Commercient_ArCustomerCode__c, PhonePhone, TypeType, BillingStreetBillingStreet, BillingCityBillingCity
SOUTHWARE SalesPerson SyncCommercientSF40__RSMAN__c41salespersonnumberCommercientSF40__salespersonnumber__c, salespersonnameCommercientSF40__salespersonname__c, salespersoninitialsCommercientSF40__salespersoninitials__c, territoryCommercientSF40__territory__c, commisssalesptdCommercientSF40__commisssalesptd__c
SOUTHWARE Customer SyncCommercientSF40__RCUST__c76groupnumberCommercientSF40__groupnumber__c, customernumberCommercientSF40__customernumber__c, salespersonnumberCommercientSF40__salespersonnumber__c, customernameCommercientSF40__customername__c, addressline1CommercientSF40__addressline1__c
Account Reverse Lookup SyncAccount2CommercientSFommercient_ArCustomerCodeCommercientSF__Commercient_ArCustomerCode__c, CommercientSF40__SouthWare_CustomerCommercientSF40__SouthWare_Customer__c
SOUTHWARE Ship To Address SyncCommercientSF40__RSHIP__c28customernumberCommercientSF40__customernumber__c, shiptonumberCommercientSF40__shiptonumber__c, shiptonameCommercientSF40__shiptoname__c, shiptoaddress1CommercientSF40__shiptoaddress1__c, shiptoaddress2CommercientSF40__shiptoaddress2__c
SOUTHWARE Salesorder Header SyncCommercientSF40__SBIL1__c93AccountCommercientSF40__account__c, SouthWare_RCUSTCommercientSF40__southware_rcust__c, amount_1CommercientSF40__amount_1__c, appldeposoverrideCommercientSF40__appldeposoverride__c, araccountCommercientSF40__araccount__c
SOUTHWARE Salesorder Line SyncCommercientSF40__SBIL2__c86ordernumberCommercientSF40__ordernumber__c, linenumberCommercientSF40__linenumber__c, itemtypecdisrCommercientSF40__itemtypecdisr__c, itemidstocksvcCommercientSF40__itemidstocksvc__c, locationnumberCommercientSF40__locationnumber__c
SOUTHWARE Invoice Header SyncCommercientSF40__SHST1__c106AccountCommercientSF40__account__c, RCUSTCommercientSF40__rcust__c, acctsrecacctnoCommercientSF40__acctsrecacctno__c, applytonumberCommercientSF40__applytonumber__c, billtoaddr3CommercientSF40__billtoaddr3__c
SOUTHWARE Invoice Line SyncCommercientSF40__SHST2__c72invoicenumberCommercientSF40__invoicenumber__c, linenumberCommercientSF40__linenumber__c, invoicedateCommercientSF40__invoicedate__c, customernumberCommercientSF40__customernumber__c, lineitemcdisrCommercientSF40__lineitemcdisr__c
SOUTHWARE Invoice Payment SyncCommercientSF40__SHST4__c40InvoiceNumberInvoiceNumber, SequenceSequence, ReceivedDateReceivedDate, OperatorCommercientSF40__Operator__c, LocationLocation

6. Community templates

The catalogue carries 31 community templates for this pair. A community template is authored in a tenant rather than shipped with the product, and it imports the same way as any other. Its own names, notes, field mapping and SQL are tenant content, so what this section states is what the set amounts to: how many templates there are, what they default to doing, which destination objects they write and which groups they fall in. They are not part of the shipped set described above.

  • Templates: 31
  • Default operations: insert on 31, update on 31, delete on 31
  • Marked circular-sync: 0
  • Licence groups they span: 11
  • Destination objects: Account, CommercientSF40__RCUST__c, CommercientSF40__RSHIP__c, CommercientSF40__RSMAN__c, CommercientSF40__SBIL1__c, CommercientSF40__SBIL2__c, CommercientSF40__SHST1__c, CommercientSF40__SHST2__c, Opportunity, PricebookEntry, User, CommercientSF40__SHST4__c, Contact, ContentDocument, product2 and 2 custom objects
  • Object display names: Account Reverse Lookup Sync, Account Sync, Get Salesforce Users, SOUTHWARE Customer Sync, SOUTHWARE Invoice Header Sync, SOUTHWARE Invoice Line Sync, SOUTHWARE Salesorder Header Sync, SOUTHWARE Salesorder Line Sync, SOUTHWARE SalesPerson Sync, SOUTHWARE Ship To Address Sync, Account Sync Update, Opportunity Sync and 9 more
  • Template groups: Account, Invoice, Product, Salesorder, CRM Opportunity and Line, Customer Multi Ship Addresses

A community template is imported the way a shipped one is, and the same rules apply to what it creates: read the process it creates with crmpro_get_process, its mapping with crmpro_field_mapping, and the view it selects from, before activating it.

7. Verifying

# per-prefix counts; every synced record carries its destination id
dlake tool query --profile <tenant> --sql "SELECT LEFT([Key], CHARINDEX(':',[Key])-1) AS prefix, COUNT(*) n, COUNT(NULLIF(SFDCID,'')) withId FROM dbo.TimeStampRepository WHERE CHARINDEX(':',[Key])>0 GROUP BY LEFT([Key], CHARINDEX(':',[Key])-1)"

withId = n for every prefix is the success condition dlake-crmpro defines. The split is on the first colon, which is the prefix boundary whether the key separator is : or ::.

The prefixes these templates set:

  • vw_SOUTHWARE_GetUser
  • vw_SOUTHWARE_AccountReverseLookup
  • vw_SOUTHWARE_Customer
  • vw_SOUTHWARE_ShipToAddress
  • vw_SOUTHWARE_InvoiceHeader
  • vw_SOUTHWARE_InvoiceLine
  • vw_SOUTHWARE_InvoicePayment
  • vw_SOUTHWARE_SalesOrderHeader
  • vw_SOUTHWARE_SalesOrderLine
  • vw_SOUTHWARE_SalesPerson

8. Where this sits

dlake-crmpro is the general operating surface — the crmpro_* tools, the setup and transaction tables, field mapping, and the source-view contract that applies to every destination. This page adds what the shipped SouthWare → Salesforce templates set up. dlake-crmpro-salesforce is the destination skill this page sits under: its own text is the authority for the Salesforce conventions that hold across every ERP, and its ERP table lists this page alongside every sibling ERP page for this destination. For the extract leg that fills the clone tables, see dlake-normalsync; for the on-premises agent that runs it, dlake-syncagent; for the writeback leg, dlake-txdownloaderpro; for standing an integration up, dlake-integration-setup.