Source ERP · 6 of 11

CRMPro → MDC — Sage 100 2017: what the shipped templates set up

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

CRMPro → MDC — Sage 100 2017: 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-mdc is the destination skill this page is a child of, and the authority for the MDC 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-mdc/erps/sage-100-2017.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Sage 100 2017 → MDC 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
salesorderThe templates push salesorder to MDC.salesorderSF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
salesorderdetailThe templates push salesorderdetail to MDC.salesorderdetailSF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
invoiceThe templates push invoice to MDC.invoiceSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
invoicedetailThe templates push invoicedetail to MDC.invoicedetailSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
quotedetailThe templates push quotedetail to MDC.quotedetailSF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
SAGE1002017 SalesOrderThe templates push comrcint_sage1002017_salesorder to MDC.comrcint_sage1002017_salesorderSF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
SAGE1002017 SalesOrder DetailThe templates push comrcint_sage1002017_salesorderdetail to MDC.comrcint_sage1002017_salesorderdetailSF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
SAGE1002017 InvoiceThe templates push comrcint_sage1002017_invoice to MDC.comrcint_sage1002017_invoiceSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
SAGE1002017 Invoice DetailThe templates push comrcint_sage1002017_invoicedetail to MDC.comrcint_sage1002017_invoicedetailSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
CRM Quote and LineThe templates push quote to MDC.quoteSF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, 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
salesordersalesordercomrcint_externalkey22vw_SAGE1002017_STD_SalesOrder:vw_SAGE1002017_STD_SalesOrder'' / ''1
salesorderdetailsalesorderdetailcomrcint_externalkey23vw_SAGE1002017_STD_SalesDetail:vw_SAGE1002017_STD_SalesDetail'' / ''1
invoiceinvoicecomrcint_externalkey24vw_SAGE1002017_STD_InvoiceHeader:vw_SAGE1002017_STD_InvoiceHeader'' / ''1
invoicedetailinvoicedetailcomrcint_externalkey25vw_SAGE1002017_STD_InvoiceDetail:vw_SAGE1002017_STD_InvoiceDetail'' / ''1
quotequotecomrcint_externalkey26vw_SAGE1002017_STD_Quote:vw_SAGE1002017_STD_Quote'' / ''1
quotedetailquotedetailcomrcint_externalkey27vw_SAGE1002017_STD_QuoteDetail:vw_SAGE1002017_STD_QuoteDetail'' / ''1
SAGE1002017 SalesOrdercomrcint_sage1002017_salesordercomrcint_externalkey28vw_SAGE1002017_SalesOrder:vw_SAGE1002017_SalesOrdercomrcint_ / ''1
SAGE1002017 SalesOrder Detailcomrcint_sage1002017_salesorderdetailcomrcint_externalkey29vw_SAGE1002017_SalesDetail:vw_SAGE1002017_SalesDetailcomrcint_ / ''1
SAGE1002017 Invoicecomrcint_sage1002017_invoicecomrcint_externalkey30vw_SAGE1002017_InvoiceHeader:vw_SAGE1002017_InvoiceHeadercomrcint_ / ''1
SAGE1002017 Invoice Detailcomrcint_sage1002017_invoicedetailcomrcint_externalkey31vw_SAGE1002017_InvoiceDetail:vw_SAGE1002017_InvoiceDetailcomrcint_ / ''1

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 '', Sync_Batch_Size 200. Text columns a template does not use are inserted as '' rather than left NULL.

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_SAGE1002017_STD_SalesOrderinsert-onlyAR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_SalesOrder:comrcint_externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
vw_SAGE1002017_STD_SalesDetailinsert-onlyCRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_STD_SalesDetail:comrcint_externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002017_STD_InvoiceHeaderinsert + updateAR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_InvoiceHeader:comrcint_externalkeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
vw_SAGE1002017_STD_InvoiceDetailinsert + updatevw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_InvoiceDetail:comrcint_externalkeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002017_STD_Quoteinsert-onlyAR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_Quote:comrcint_externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
vw_SAGE1002017_STD_QuoteDetailinsert-onlyCRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_Quote:, vw_SAGE1002017_STD_QuoteDetail:comrcint_externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002017_SalesOrderinsert-onlyAR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_SalesOrder:externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
vw_SAGE1002017_SalesDetailinsert-onlyCRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_SalesDetail:externalkeySF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL, SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGE1002017_InvoiceHeaderinsert + updateAR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_InvoiceHeader:externalkeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS, CommercientFlags
vw_SAGE1002017_InvoiceDetailinsert + updatevw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_InvoiceDetail:externalkeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, SF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS

4. Order of work

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

  • 22 — salesorder
  • 23 — salesorderdetail
  • 24 — invoice
  • 25 — invoicedetail
  • 26 — quote
  • 27 — quotedetail
  • 28 — SAGE1002017 SalesOrder
  • 29 — SAGE1002017 SalesOrder Detail
  • 30 — SAGE1002017 Invoice
  • 31 — SAGE1002017 Invoice Detail

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_SAGE1002017_STD_SalesOrder reads AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_SalesOrder:; no template in this set writes AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_SalesOrder:
  • vw_SAGE1002017_STD_SalesDetail reads CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_STD_SalesDetail:; no template in this set writes CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_STD_SalesDetail:
  • vw_SAGE1002017_STD_InvoiceHeader reads AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_InvoiceHeader:; no template in this set writes AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_InvoiceHeader:
  • vw_SAGE1002017_STD_InvoiceDetail reads vw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_InvoiceDetail:; no template in this set writes vw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_InvoiceDetail:
  • vw_SAGE1002017_STD_QuoteDetail reads CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_Quote:, vw_SAGE1002017_STD_QuoteDetail:; no template in this set writes CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_Quote:, vw_SAGE1002017_STD_QuoteDetail:
  • vw_SAGE1002017_SalesOrder reads AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_SalesOrder:; no template in this set writes AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_SalesOrder:
  • vw_SAGE1002017_SalesDetail reads CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_SalesDetail:; no template in this set writes CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_STD_SalesOrder:, vw_SAGE1002017_SalesDetail:
  • vw_SAGE1002017_InvoiceHeader reads AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_InvoiceHeader:; no template in this set writes AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_InvoiceHeader:
  • vw_SAGE1002017_InvoiceDetail reads vw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_InvoiceDetail:; no template in this set writes vw_SAGE1002017_STD_InvoiceHeader:, CRM_Account:, vw_SAGE100_Product:, vw_SAGE1002017_InvoiceDetail:
  • vw_SAGE1002017_STD_Quote reads AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_Quote:; no template in this set writes AR_CUSTOMER:, CRM_Account:, vw_SAGE1002017_STD_Quote:

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 → MDC pairs
salesordersalesorder20SALESORDERNOcomrcint_externalkey, SALESORDERNOname, ADDRESSLINE1billto_line1, ADDRESSLINE2billto_line2, ADDRESSLINE3billto_line3
salesorderdetailsalesorderdetail12SALESORDERNO, LINEKEYcomrcint_externalkey, SHIPTOADDRESS1shipto_line1, SHIPTOADDRESS2shipto_line2, SHIPTOADDRESS3shipto_line3, SHIPTOCITYshipto_city
invoiceinvoice20ADDRESSLINE1billto_line1, ADDRESSLINE2billto_line2, ADDRESSLINE3billto_line3, CITYbillto_city, STATEbillto_stateorprovince
invoicedetailinvoicedetail12INVOICENO, HEADERSEQNO, DETAILSEQNOcomrcint_externalkey, SHIPTOADDRESS1shipto_line1, SHIPTOADDRESS2shipto_line2, SHIPTOADDRESS3shipto_line3, SHIPTOCITYshipto_city
quotequote20SALESORDERNOcomrcint_externalkey, SALESORDERNOname, ADDRESSLINE1billto_line1, ADDRESSLINE2billto_line2, ADDRESSLINE3billto_line3
quotedetailquotedetail12SALESORDERNO, LINEKEYcomrcint_externalkey, SHIPTOADDRESS1shipto_line1, SHIPTOADDRESS2shipto_line2, SHIPTOADDRESS3shipto_line3, SHIPTOCITYshipto_city
SAGE1002017 SalesOrdercomrcint_sage1002017_salesorder4SALESORDERNOexternalkey, SALESORDERNOname, ARDIVISIONNO, CUSTOMERNOaccount__customerid__lookup, Commercient Price Listpricelevel__pricelevelid__lookup
SAGE1002017 SalesOrder Detailcomrcint_sage1002017_salesorderdetail5SALESORDERNO, LINEKEYcomrcint_externalkey, SALESORDERNO, LINEKEYname, SALESORDERNOsalesorder__salesorderid__lookup, ITEMCODEproduct__productid__lookup, Unituom__uomid__lookup
SAGE1002017 Invoicecomrcint_sage1002017_invoice4INVOICENO, HEADERSEQNOexternalkey, INVOICENO, HEADERSEQNOName, ARDIVISIONNO, CUSTOMERNOaccount__customerid__lookup, Commercient Price Listpricelevel__pricelevelid__lookup
SAGE1002017 Invoice Detailcomrcint_sage1002017_invoicedetail5INVOICENO, HEADERSEQNO, DETAILSEQNOexternalkey, INVOICENO, HEADERSEQNO, DETAILSEQNOname, SFDCIDinvoice__invoiceid__lookup, ITEMCODEproduct__productid__lookup, UOMuom__uomid__lookup

6. 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_SAGE1002017_STD_SalesOrder:
  • vw_SAGE1002017_STD_SalesDetail:
  • vw_SAGE1002017_STD_InvoiceHeader:
  • vw_SAGE1002017_STD_InvoiceDetail:
  • vw_SAGE1002017_STD_QuoteDetail:
  • vw_SAGE1002017_SalesOrder:
  • vw_SAGE1002017_SalesDetail:
  • vw_SAGE1002017_InvoiceHeader:
  • vw_SAGE1002017_InvoiceDetail:
  • vw_SAGE1002017_STD_Quote:

7. 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 2017 → MDC templates set up. dlake-crmpro-mdc is the destination skill this page sits under: its own text is the authority for the MDC 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.