Source ERP · 73 of 105

CRMPro → Salesforce — Sage 100 2016: what the shipped templates set up

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

CRMPro → Salesforce — Sage 100 2016: 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/sage-100-2016.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Sage 100 2016 → 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 USERThe templates push users to Salesforce. New records are created, existing ones updated, and records removed in the ERP are deleted.users
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, CommercientSF8__AR_CUSTOMER__c, CommercientSF8__SAGE100_SalesPerson__cSF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, SF_ERP_Salesforce_Clone_AR_SALESPERSON
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 and existing ones updated; none are deleted.CommercientSF8__SO_SHIPTOADDRESS__cSF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
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.CommercientSF8__AR_INVOICEHISTORYHEADER__c, CommercientSF8__AR_INVOICEHISTORYDETAIL__c, CommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__cSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_OPENINVOICE, SF_ERP_Salesforce_Clone_AR_SALESPERSON, CommercientFlags, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_CI_ITEM
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.CommercientSF8__SO_SALESORDERDETAIL__c, CommercientSF8__SO_SALESORDERHEADER__cSF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, CommercientFlags

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 USERusers0vw_SAGE1002016_User1=0'' / ''1
SAGE1002016 Sales PersonCommercientSF8__SAGE100_SalesPerson__cCommercientSF8__ExternalKey__c2vwSalesPersonvw_SAGE1002016_SalesPersonCommercientSF8__ / __c
SAGE1002016 AccountAccountCommercientSF__Commercient_ArCustomerCode__c3vwSalesForceAccountvw_SAGE1002016_Account'' / ''
SAGE1002016 CustomerCommercientSF8__AR_CUSTOMER__cCommercientSF8__ExternalKey__c4vwAR_CUSTOMERvw_SAGE1002016_CUSTOMERCommercientSF8__ / __c
SAGE1002016 ShipToAddressCommercientSF8__SO_SHIPTOADDRESS__cCommercientSF8__ExternalKey__c5SO_SHIPTOADDRESSvw_SAGE1002016_SO_SHIPTOADDRESSCommercientSF8__ / __c
SAGE1002016 SalesOrderHeaderCommercientSF8__SO_SALESORDERHEADER__cCommercientSF8__SALESORDERNO__c6vwSO_SALESORDERHEADERvw_SAGE1002016_SO_SALESORDERHEADERCommercientSF8__ / __c
SAGE1002016 SalesOrderDetailCommercientSF8__SO_SALESORDERDETAIL__cCommercientSF8__ExternalKey__c7vwSO_SALESORDERDETAILvw_SAGE1002016_SO_SALESORDERDETAILCommercientSF8__ / __c
SAGE1002016 InvoiceHistoryHeaderCommercientSF8__AR_INVOICEHISTORYHEADER__cCommercientSF8__ExternalKey__c8vwAR_INVOICEHISTORYHEADERvw_SAGE1002016_AR_INVOICEHISTORYHEADERCommercientSF8__ / __c
SAGE1002016 InvoiceHistoryDetailCommercientSF8__AR_INVOICEHISTORYDETAIL__cCommercientSF8__ExternalKey__c9vwAR_INVOICEHISTORYDETAILvw_SAGE1002016_AR_INVOICEHISTORYDETAILCommercientSF8__ / __c
SAGE1002016 InvoicePaynentCommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__cCommercientSF8__ExternalKey__c10vwAR_TRANSACTIONPAYMENTHISTORYvw_SAGE1002016_AR_TRANSACTIONPAYMENTHISTORYCommercientSF8__ / __c
SAGE1002016 Customer Reverse LookupAccountCommercientSF__Commercient_ArCustomerCode__c11vw_CustomerToAccountLookupvw_SAGE1002016_CustomerToAccountLookup'' / ''

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, Sync_Batch_Size 200. IsAccountMatching is set on SAGE1002016 Account. Text columns a template does not use are inserted as '' rather than left NULL. Get_SOQL_Query carries a query on GET USER — 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_SAGE1002016_SalesPersoninsert + updatevwSalesPerson:ExternalKeySF_ERP_Salesforce_Clone_AR_SALESPERSON
vw_SAGE1002016_Accountinsert + updatevwSalesForceAccount:vw_SAGE1002016_User:SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002016_CUSTOMERinsert + updatevwAR_CUSTOMER:vwSalesForceAccount:, vwSalesPerson:ExternalKeySF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_AR_SALESPERSON
vw_SAGE1002016_SO_SHIPTOADDRESSinsert + updateSO_SHIPTOADDRESS:vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:ExternalKeySF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002016_SO_SALESORDERHEADERinsert + updatevwSO_SALESORDERHEADER:vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, CommercientFlags
vw_SAGE1002016_SO_SALESORDERDETAILinsert + updatevwSO_SALESORDERDETAIL:vwSO_SALESORDERHEADER:ExternalKeySF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER
vw_SAGE1002016_AR_INVOICEHISTORYHEADERinsert + updatevwAR_INVOICEHISTORYHEADER:vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:, SO_SHIPTOADDRESS:ExternalKeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_OPENINVOICE, SF_ERP_Salesforce_Clone_AR_SALESPERSON, CommercientFlags
vw_SAGE1002016_AR_INVOICEHISTORYDETAILinsert + updatevwAR_INVOICEHISTORYDETAIL:vwAR_INVOICEHISTORYHEADER:ExternalKeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_CI_ITEM
vw_SAGE1002016_AR_TRANSACTIONPAYMENTHISTORYinsert + updatevwAR_TRANSACTIONPAYMENTHISTORY:vwAR_INVOICEHISTORYHEADER:ExternalKeySF_ERP_Salesforce_Clone_AR_TRANSACTIONPAYMENTHISTORY, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, CommercientFlags
vw_SAGE1002016_CustomerToAccountLookupinsert + updatevw_CustomerToAccountLookup:vwAR_CUSTOMER:SF_ERP_Salesforce_Clone_AR_CUSTOMER

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

  • 0 — GET USER
  • 2 — SAGE1002016 Sales Person
  • 3 — SAGE1002016 Account
  • 4 — SAGE1002016 Customer
  • 5 — SAGE1002016 ShipToAddress
  • 6 — SAGE1002016 SalesOrderHeader
  • 7 — SAGE1002016 SalesOrderDetail
  • 8 — SAGE1002016 InvoiceHistoryHeader
  • 9 — SAGE1002016 InvoiceHistoryDetail
  • 10 — SAGE1002016 InvoicePaynent
  • 11 — SAGE1002016 Customer Reverse Lookup

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_SAGE1002016_Account reads vw_SAGE1002016_User:
  • vw_SAGE1002016_CustomerToAccountLookup reads vwAR_CUSTOMER:
  • vw_SAGE1002016_CUSTOMER reads vwSalesForceAccount:, vwSalesPerson:
  • vw_SAGE1002016_SO_SHIPTOADDRESS reads vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:
  • vw_SAGE1002016_AR_INVOICEHISTORYHEADER reads vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:, SO_SHIPTOADDRESS:
  • vw_SAGE1002016_AR_INVOICEHISTORYDETAIL reads vwAR_INVOICEHISTORYHEADER:
  • vw_SAGE1002016_AR_TRANSACTIONPAYMENTHISTORY reads vwAR_INVOICEHISTORYHEADER:
  • vw_SAGE1002016_SO_SALESORDERDETAIL reads vwSO_SALESORDERHEADER:
  • vw_SAGE1002016_SO_SALESORDERHEADER reads vwSalesForceAccount:, vwAR_CUSTOMER:, vwSalesPerson:

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
SAGE1002016 Sales PersonCommercientSF8__SAGE100_SalesPerson__c26SALESPERSONDIVISIONNO,SALESPERSONNOCommercientSF8__ExternalKey__c, SALESPERSONNAMECommercientSF8__NAME__c, SALESPERSONDIVISIONNOCommercientSF8__SALESPERSONDIVISIONNO__c, SALESPERSONNOCommercientSF8__SALESPERSONNO__c, ADDRESSLINE1CommercientSF8__ADDRESSLINE1__c
SAGE1002016 AccountAccount22ARDIVISIONNO, CUSTOMERNOCommercientSF__Commercient_ArCustomerCode__c, CUSTOMERNAMEName, ADDRESSLINE1BillingAddressLine1, ADDRESSLINE2BillingAddressLine2, ADDRESSLINE3BillingAddressLine3
SAGE1002016 CustomerCommercientSF8__AR_CUSTOMER__c79CUSTOMERNOCommercientSF8__ExternalKey__c, CUSTOMERNAMECommercientSF8__Name__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, CUSTOMERNAMECommercientSF8__CUSTOMERNAME__c, ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c
SAGE1002016 ShipToAddressCommercientSF8__SO_SHIPTOADDRESS__c34ARDIVISIONNO,CUSTOMERNO,SHIPTOCODECommercientSF8__ExternalKey__c, ARDIVISIONNO,CUSTOMERNO,SHIPTOCODECommercientSF8__Name__c, ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, SHIPTOCODECommercientSF8__SHIPTOCODE__c
SAGE1002016 SalesOrderHeaderCommercientSF8__SO_SALESORDERHEADER__c106SALESORDERNOCommercientSF8__SALESORDERNO__c, ORDERDATECommercientSF8__ORDERDATE__c, ORDERTYPECommercientSF8__ORDERTYPE__c, ORDERSTATUSCommercientSF8__ORDERSTATUS__c, MASTERREPEATINGORDERNOCommercientSF8__MASTERREPEATINGORDERNO__c
SAGE1002016 SalesOrderDetailCommercientSF8__SO_SALESORDERDETAIL__c65SALESORDERNO,LINEKEYCommercientSF8__ExternalKey__c, ORDERTYPECommercientSF8__ORDERTYPE__c, SALESORDERNOCommercientSF8__SALESORDERNO__c, LINEKEYCommercientSF8__LINEKEY__c, LINESEQNOCommercientSF8__LINESEQNO__c
SAGE1002016 InvoiceHistoryHeaderCommercientSF8__AR_INVOICEHISTORYHEADER__c124INVOICENO, HEADERSEQNOCommercientSF8__ExternalKey__c, INVOICENO, HEADERSEQNOCommercientSF8__Name__c, INVOICENOCommercientSF8__INVOICENO__c, HEADERSEQNOCommercientSF8__HEADERSEQNO__c, MODULECODECommercientSF8__MODULECODE__c
SAGE1002016 InvoiceHistoryDetailCommercientSF8__AR_INVOICEHISTORYDETAIL__c59INVOICENO, HEADERSEQNO, DETAILSEQNOCommercientSF8__ExternalKey__c, INVOICENOCommercientSF8__INVOICENO__c, HEADERSEQNOCommercientSF8__HEADERSEQNO__c, DETAILSEQNOCommercientSF8__DETAILSEQNO__c, ITEMCODECommercientSF8__ITEMCODE__c
SAGE1002016 InvoicePaynentCommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__c33ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, INVOICENOCommercientSF8__INVOICENO__c, INVOICETYPECommercientSF8__INVOICETYPE__c, INVOICEHISTORYHEADERSEQNOCommercientSF8__INVOICEHISTORYHEADERSEQNO__c
SAGE1002016 Customer Reverse LookupAccount2ARDIVISIONNO,CUSTOMERNOCommercientSF__Commercient_ArCustomerCode__c, SFDCIDCommercientSF8__Sage_Customer_Record__c

6. Community templates

The catalogue carries 244 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: 244
  • Default operations: insert on 244, update on 244, delete on 244
  • Marked circular-sync: 2
  • Licence groups they span: 14
  • Destination objects: Account, CommercientSF8__SAGE100_CI_Item__c, CommercientSF8__SO_SALESORDERDETAIL__c, CommercientSF8__AR_INVOICEHISTORYDETAIL__c, CommercientSF8__AR_INVOICEHISTORYHEADER__c, CommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__c, CommercientSF8__SO_SALESORDERHEADER__c, CommercientSF8__AR_CUSTOMER__c, CommercientSF8__SAGE100_PO_PURCHASEORDERHEADER__c, CommercientSF8__SAGE100_AP_VENDOR__c, CommercientSF8__SAGE100_ItemWarehouse__c, CommercientSF8__SAGE100_PO_PURCHASEORDERDETAIL__c, CommercientSF8__SO_SHIPTOADDRESS__c, CommercientSF8__SAGE100_SalesPerson__c, CommercientSF8__SAGE100_GL_ACCOUNT__c, Product2, ContentDocument, ACCOUNT, CommercientSF8__SAGE100_SALESORDERHISTORYDETAIL__c, CommercientSF8__SAGE100_SALESORDERHISTORYHEADER__c, 16 more and 14 custom objects
  • Object display names: SYNC ITEM, SYNC ITEMWAREHOUSE, SYNC ACCOUNT, SYNC CUSTOMER, SYNC INVOICEHISTORYDETAIL, SYNC INVOICEHISTORYHEADER, SYNC SALESORDERDETAIL, SYNC TRANSACTIONPAYMENTHISTORY, SYNC GLACCOUNT, SYNC POPURCHASEORDERDETAIL, SYNC PURCHASEORDERHEADER, SYNC SALESORDERHEADER, 49 more and 42 further templates
  • Template groups: Account, Product, Invoice History Headers, Salesorder, Purchase Order, Customer Multi Ship Addresses, Invoice, File/Document Sync

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_SAGE1002016_User
  • vwSalesForceAccount
  • vw_CustomerToAccountLookup
  • vwAR_CUSTOMER
  • SO_SHIPTOADDRESS
  • vwAR_INVOICEHISTORYHEADER
  • vwAR_INVOICEHISTORYDETAIL
  • vwAR_TRANSACTIONPAYMENTHISTORY
  • vwSO_SALESORDERDETAIL
  • vwSO_SALESORDERHEADER
  • vwSalesPerson

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 Sage 100 2016 → 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.