Source ERP · 7 of 105

CRMPro → Salesforce — Aptean Ross: what the shipped templates set up

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

CRMPro → Salesforce — Aptean Ross: 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/aptean-ross.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Aptean Ross → 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
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 and existing ones updated; none are deleted.Account, CommercientSF21__CUSTOMERS__c, CommercientSF21__CUSTOMER_ADDRESSES__c, CommercientSF21__SALESPERSONS__cSF_ERP_Salesforce_Clone_CUSTOMERS, SF_ERP_Salesforce_Clone_CUSTOMER_ADDRESSES, SF_ERP_Salesforce_Clone_SALESPERSONS
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 and existing ones updated; none are deleted.CommercientSF21__SALES_ORDER_INVOICES__c, CommercientSF21__SALES_ORDER_INVOICE_LINES__cSF_ERP_Salesforce_Clone_SALES_ORDER_LINES, SF_ERP_Salesforce_Clone_PRODUCT_MASTER, SF_ERP_Salesforce_Clone_SALES_ORDER_HISTORY, SF_ERP_Salesforce_Clone_SALES_ORDER_INVOICE_LINES
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 and existing ones updated; none are deleted.CommercientSF21__SALES_ORDER_HEADERS__c, CommercientSF21__SALES_ORDER_LINES__c, CommercientSF21__SALES_ORDER_HISTORY__c, CommercientSF21__SALES_ORDER_LINE_QTYS__cSF_ERP_Salesforce_Clone_SALES_ORDER_HEADERS, CommercientFlags, SF_ERP_Salesforce_Clone_SALES_ORDER_LINES, SF_ERP_Salesforce_Clone_PRODUCT_MASTER, SF_ERP_Salesforce_Clone_SALES_ORDER_HISTORY, SF_ERP_Salesforce_Clone_SALES_ORDER_LINE_QTYS

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 / postfix
APTEANROSS SALESPERSONSCommercientSF21__SALESPERSONS__cCommercientSF21__ExternalKey__c1SALESPERSONSvw_APTEANROSS_SALESPERSONSCommercientSF21__ / __c
AccountAccountCommercientSF__Commercient_ArCustomerCode__c2Accountvw_APTEANROSS_Account'' / ''
APTEANROSS CUSTOMERSCommercientSF21__CUSTOMERS__cCommercientSF21__ExternalKey__c3CUSTOMERSvw_APTEANROSS_CUSTOMERSCommercientSF21__ / __c
APTEANROSS CUSTOMER_ADDRESSESCommercientSF21__CUSTOMER_ADDRESSES__cCommercientSF21__ExternalKey__c4ADDRESSESvw_APTEANROSS_ADDRESSESCommercientSF21__ / __c
APTEANROSS SALES_ORDER_HEADERSCommercientSF21__SALES_ORDER_HEADERS__cCommercientSF21__ExternalKey__c5ORDER_HEADERSvw_APTEANROSS_ORDER_HEADERSCommercientSF21__ / __c
APTEANROSS SALES_ORDER_LINESCommercientSF21__SALES_ORDER_LINES__cCommercientSF21__ExternalKey__c6ORDER_LINESvw_APTEANROSS_ORDER_LINESCommercientSF21__ / __c
APTEANROSS SALES_ORDER_INVOICESCommercientSF21__SALES_ORDER_INVOICES__cCommercientSF21__ExternalKey__c7ORDER_INVOICESvw_APTEANROSS_ORDER_INVOICESCommercientSF21__ / __c
APTEANROSS SALES_ORDER_INVOICE_LINESCommercientSF21__SALES_ORDER_INVOICE_LINES__cCommercientSF21__ExternalKey__c8ORDER_INVOICES_LINESvw_APTEANROSS_ORDER_INVOICE_LINESCommercientSF21__ / __c
APTEANROSS SALES_ORDER_HISTORYCommercientSF21__SALES_ORDER_HISTORY__cCommercientSF21__ExternalKey__c9ORDER_HISTORYvw_APTEANROSS_ORDER_HISTORYCommercientSF21__ / __c
APTEANROSS SALES_ORDER_LINES_QTYSCommercientSF21__SALES_ORDER_LINE_QTYS__cCommercientSF21__ExternalKey__c10ORDER_LINES_QTYSvw_APTEANROSS_ORDER_LINES_QTYSCommercientSF21__ / __c

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 1. The insert column lists do not include Sync_Operation_Type, Sync_Batch_Size, Document_Source_Path, so those columns take their CRM_Configuration defaults. Text columns a template does not use are inserted as '' rather than left NULL. Get_SOQL_Query carries a query on Account — those rows read records back from Salesforce as well as pushing. On APTEANROSS SALES_ORDER_INVOICES the SQL_Query names a view the same template’s CreateViewQuery does not create (vw_APTEANROSS_ORDER_INVOICES against vw_APTEANROSS_ORDER_LINES), so check the view exists under the name the row selects from before activating it.

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_APTEANROSS_SALESPERSONSinsert + updateSALESPERSONS:ExternalKeySF_ERP_Salesforce_Clone_SALESPERSONS
vw_APTEANROSS_AccountAccount:SALESPERSONS:SF_ERP_Salesforce_Clone_CUSTOMERS, SF_ERP_Salesforce_Clone_CUSTOMER_ADDRESSES
vw_APTEANROSS_CUSTOMERSinsert + updateCUSTOMERS:Account:, SALESPERSONS:ExternalKeySF_ERP_Salesforce_Clone_CUSTOMERS
vw_APTEANROSS_ADDRESSESinsert + updateADDRESSES:Account:, CUSTOMERS:, SALESPERSONS:ExternalKeySF_ERP_Salesforce_Clone_CUSTOMER_ADDRESSES
vw_APTEANROSS_ORDER_HEADERSinsert + updateORDER_HEADERS:Account:, CUSTOMERS:SF_ERP_Salesforce_Clone_SALES_ORDER_HEADERS, CommercientFlags
vw_APTEANROSS_ORDER_LINESinsert + updateORDER_LINES:ORDER_HEADERS:SF_ERP_Salesforce_Clone_SALES_ORDER_LINES, SF_ERP_Salesforce_Clone_PRODUCT_MASTER, SF_ERP_Salesforce_Clone_SALES_ORDER_HISTORY
vw_APTEANROSS_ORDER_LINESinsert + updateORDER_HEADERS:, ORDER_LINES:SF_ERP_Salesforce_Clone_SALES_ORDER_LINES, SF_ERP_Salesforce_Clone_PRODUCT_MASTER, SF_ERP_Salesforce_Clone_SALES_ORDER_HISTORY
vw_APTEANROSS_ORDER_INVOICE_LINESinsert + updateORDER_INVOICES_LINES:ORDER_INVOICES:SF_ERP_Salesforce_Clone_SALES_ORDER_INVOICE_LINES
vw_APTEANROSS_ORDER_HISTORYinsert + updateORDER_HISTORY:Account:, CUSTOMERS:, ORDER_HEADERS:SF_ERP_Salesforce_Clone_SALES_ORDER_HISTORY, CommercientFlags
vw_APTEANROSS_ORDER_LINES_QTYSinsert + updateORDER_LINES_QTYS:ORDER_LINES:SF_ERP_Salesforce_Clone_SALES_ORDER_LINE_QTYS, SF_ERP_Salesforce_Clone_SALES_ORDER_LINES

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 1 to 10. A run processes active rows in ascending Sync_Order, which is the order the templates put them in:

  • 1 — APTEANROSS SALESPERSONS
  • 2 — Account
  • 3 — APTEANROSS CUSTOMERS
  • 4 — APTEANROSS CUSTOMER_ADDRESSES
  • 5 — APTEANROSS SALES_ORDER_HEADERS
  • 6 — APTEANROSS SALES_ORDER_LINES
  • 7 — APTEANROSS SALES_ORDER_INVOICES
  • 8 — APTEANROSS SALES_ORDER_INVOICE_LINES
  • 9 — APTEANROSS SALES_ORDER_HISTORY
  • 10 — APTEANROSS SALES_ORDER_LINES_QTYS

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_APTEANROSS_Account reads SALESPERSONS:
  • vw_APTEANROSS_CUSTOMERS reads Account:, SALESPERSONS:
  • vw_APTEANROSS_ADDRESSES reads Account:, CUSTOMERS:, SALESPERSONS:
  • vw_APTEANROSS_ORDER_LINES reads ORDER_HEADERS:, ORDER_LINES:
  • vw_APTEANROSS_ORDER_INVOICE_LINES reads ORDER_INVOICES:
  • vw_APTEANROSS_ORDER_HEADERS reads Account:, CUSTOMERS:
  • vw_APTEANROSS_ORDER_LINES reads ORDER_HEADERS:
  • vw_APTEANROSS_ORDER_HISTORY reads Account:, CUSTOMERS:, ORDER_HEADERS:
  • vw_APTEANROSS_ORDER_LINES_QTYS reads ORDER_LINES:

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
APTEANROSS SALESPERSONSCommercientSF21__SALESPERSONS__c25COMPANY_CODE,SALESPERSON_CODECommercientSF21__ExternalKey__c, CODE_DESCRIPTIONNAME, GEM_DBKEYGEM_DBKEY, COMPANY_CODECOMPANY_CODE, CODE_DESCRIPTIONCODE_DESCRIPTION
AccountAccount15COMPANY_CODE, DIVISION, CUSTOMER_NUMBERCommercientSF__Commercient_ArCustomerCode__c, CUSTOMER_NAMEName, PHONEPhone, FAX_NUMBERFax, SYS_ADDRESS_1, SYS_ADDRESS_2, SYS_ADDRESS_3, SYS_ADDRESS_4BillingStreet
APTEANROSS CUSTOMERSCommercientSF21__CUSTOMERS__c15COMPANY_CODE,DIVISION,CUSTOMER_NUMBERCommercientSF21__ExternalKey__c, CUSTOMER_NAMEName, SYS_ADDRESS_1,SYS_ADDRESS_2,SYS_ADDRESS_3,SYS_ADDRESS_4BillingStreet, SYS_CITYBillingCity, SYS_STATEBillingState
APTEANROSS CUSTOMER_ADDRESSESCommercientSF21__CUSTOMER_ADDRESSES__c103COMPANY_CODE,DIVISION,CUSTOMER_NUMBER,ADDRESS_CODECommercientSF21__ExternalKey__c, CUSTOMER_NAMECommercientSF21__Name__c, GEM_DBKEYCommercientSF21__GEM_DBKEY__c, COMPANY_CODECommercientSF21__COMPANY_CODE__c, DIVISIONCommercientSF21__DIVISION__c
APTEANROSS SALES_ORDER_HEADERSCommercientSF21__SALES_ORDER_HEADERS__c100COMPANY_CODE,DIVISION,ORDER_NUMBERCommercientSF21__ExternalKey__c, ORDER_NUMBERName, GEM_DBKEYGEM_DBKEY, COMPANY_CODECOMPANY_CODE, DIVISIONDIVISION
APTEANROSS SALES_ORDER_LINESCommercientSF21__SALES_ORDER_LINES__c107GEM_DBKEYCommercientSF21__ExternalKey__c, ORDER_NUMBERCommercientSF21__ORDER_NUMBER__c, ORDER_LINE_NUMBERCommercientSF21__ORDER_LINE_NUMBER__c, ORDER_LINE_TYPECommercientSF21__ORDER_LINE_TYPE__c, PRODUCT_GROUPCommercientSF21__PRODUCT_GROUP__c
APTEANROSS SALES_ORDER_INVOICESCommercientSF21__SALES_ORDER_INVOICES__c109GEM_DBKEYCommercientSF21__ExternalKey__c, ORDER_NUMBER, ORDER_LINE_NUMBERCommercientSF21__Name__c, COMPANY_CODECommercientSF21__COMPANY_CODE__c, DIVISIONCommercientSF21__DIVISION__c, ORDER_NUMBERCommercientSF21__ORDER_NUMBER__c
APTEANROSS SALES_ORDER_INVOICE_LINESCommercientSF21__SALES_ORDER_INVOICE_LINES__c123COMPANY_CODE, DIVISION, INVOICE_NUMBER, INVOICE_LINE_NUMBERCommercientSF21__ExternalKey__c, INVOICE_NUMBER, INVOICE_LINE_NUMBERName, GEM_DBKEYGEM_DBKEY, COMPANY_CODECOMPANY_CODE, DIVISIONDIVISION
APTEANROSS SALES_ORDER_HISTORYCommercientSF21__SALES_ORDER_HISTORY__c42GEM_DBKEYCommercientSF21__ExternalKey__c, ORDER_NUMBER, ORDER_LINE_NUMBERCommercientSF21__Name__c, COMPANY_CODECommercientSF21__COMPANY_CODE__c, DIVISIONCommercientSF21__DIVISION__c, ORDER_NUMBERCommercientSF21__ORDER_NUMBER__c
APTEANROSS SALES_ORDER_LINES_QTYSCommercientSF21__SALES_ORDER_LINE_QTYS__c24ORDER_NUMBER, ORDER_LINE_NUMBER, UNIT_OF_MEASUREName, GEM_DBKEYCommercientSF21__GEM_DBKEY__c, COMPANY_CODECommercientSF21__COMPANY_CODE__c, DIVISIONCommercientSF21__DIVISION__c, ORDER_NUMBERCommercientSF21__ORDER_NUMBER__c

6. Community templates

The catalogue carries 29 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: 29
  • Default operations: insert on 29, update on 29, delete on 29
  • Marked circular-sync: 0
  • Licence groups they span: 9
  • Destination objects: Account, OrderItem, PricebookEntry, CommercientSF21__SALES_ORDER_HEADERS__c, CommercientSF21__SALES_ORDER_INVOICE_LINES__c, Product2, Aptean_Address__c, AR_Invoice_Detail__c, AR_Invoice_Header__c, CommercientSF21__CUSTOMER_ADDRESSES__c, CommercientSF21__CUSTOMERS__c, CommercientSF21__SALES_ORDER_HISTORY__c, CommercientSF21__SALES_ORDER_INVOICES__c, CommercientSF21__SALES_ORDER_LINE_QTYS__c, CommercientSF21__SALES_ORDER_LINES__c, CommercientSF21__SALESPERSONS__c, Customer_Part_Code__c, Order, Pricebook2, User
  • Object display names: Account, APTEANROSS SALES_ORDER_HEADERS, APTEANROSS SALES_ORDER_INVOICE_LINES, AccountCustomerLookup, APTEANROSS CUSTOMER_ADDRESSES, APTEANROSS SALES_ORDER_HISTORY, APTEANROSS SALES_ORDER_INVOICES, APTEANROSS SALES_ORDER_LINES, APTEANROSS SALES_ORDER_LINES_QTYS, APTEANROSS SALESPERSONS, AR Invoice, AR Invoice Detail, 13 more and a further template
  • Template groups: Account, Invoice, Product, Salesorder, CRM Order 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:

  • Account
  • CUSTOMERS
  • ADDRESSES
  • ORDER_INVOICES
  • ORDER_INVOICES_LINES
  • ORDER_HEADERS
  • ORDER_LINES
  • ORDER_HISTORY
  • ORDER_LINES_QTYS
  • SALESPERSONS

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 Aptean Ross → 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.