Source ERP · 91 of 105

CRMPro → Salesforce — Sage MAS 90: what the shipped templates set up

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

CRMPro → Salesforce — Sage MAS 90: 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-mas-90.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Sage MAS 90 → 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, existing ones updated, and records removed in the ERP are deleted.account, CommercientSF8__AR_CUSTOMER__c, CommercientSF8__SAGE100_SalesPerson__cSF_ERP_Salesforce_Clone_AR_CUSTOMER, SF_ERP_Salesforce_Clone_AR_SALESPERSON
AR Invoice PaymentsCommercient Syncs the payment details that are held in the receivables file and held against an invoice in the ERP. The amount received from a customer, the date of payment, the method of payment, whether partial or full payment, etc New records are created and existing ones updated; none are deleted.CommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__cSF_ERP_Salesforce_Clone_AR_TRANSACTIONPAYMENTHISTORY, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, CommercientFlags
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__cSF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, CommercientFlags, SF_ERP_Salesforce_Clone_AR_OPENINVOICE, SF_ERP_Salesforce_Clone_AR_SALESPERSON, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL
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_SALESORDERHEADER__c, CommercientSF8__SO_SALESORDERDETAIL__cSF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, CommercientFlags, SF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL

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_SAGEMASS90_User1=0'' / ''1
SYNC SALESPERSONCommercientSF8__SAGE100_SalesPerson__cCommercientSF8__ExternalKey__c1vw_SAGEMASS90_SALESPERSONvw_SAGEMASS90_SALESPERSONCommercientSF8__ / __c1
CRM AccountaccountCommercientSF__Commercient_ArCustomerCode__c2vw_SAGEMASS90_CRM_ACCOUNTvw_SAGEMASS90_CRM_ACCOUNT'' / ''
Sage CustomerCommercientSF8__AR_CUSTOMER__cCommercientSF8__ExternalKey__c3vw_SAGEMASS90_CUSTOMERvw_SAGEMASS90_CUSTOMERCommercientSF8__ / __c
Sage Ship To AddressCommercientSF8__SO_SHIPTOADDRESS__cCommercientSF8__ExternalKey__c5vw_SAGEMASS90_SHIPTOADDRESSvw_SAGEMASS90_SHIPTOADDRESSCommercientSF8__ / __c
Sage SalesOrder HeaderCommercientSF8__SO_SALESORDERHEADER__cCommercientSF8__SALESORDERNO__c12vw_SAGEMASS90_SALESORDERHEADERvw_SAGEMASS90_SALESORDERHEADERCommercientSF8__ / __c
Sage SalesOrder DetailCommercientSF8__SO_SALESORDERDETAIL__cCommercientSF8__ExternalKey__c13vw_SAGEMASS90_SALESORDERDETAILvw_SAGEMASS90_SALESORDERDETAILCommercientSF8__ / __c
Sage Invoice History HeaderCommercientSF8__AR_INVOICEHISTORYHEADER__cCommercientSF8__ExternalKey__c14vw_SAGEMASS90_INVOICEHISTORYHEADERvw_SAGEMASS90_INVOICEHISTORYHEADERCommercientSF8__ / __c
Sage Invoice History DetailCommercientSF8__AR_INVOICEHISTORYDETAIL__cCommercientSF8__ExternalKey__c15vw_SAGEMASS90_INVOICEHISTORYDETAILvw_SAGEMASS90_INVOICEHISTORYDETAILCommercientSF8__ / __c
Sage Transaction Payment HistoryCommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__cCommercientSF8__ExternalKey__c16vw_SAGEMASS90_TRANSACTIONPAYMENTHISTORYvw_SAGEMASS90_TRANSACTIONPAYMENTHISTORYCommercientSF8__ / __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, Sync_Batch_Size 200. IsAccountMatching is set on CRM 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_SAGEMASS90_SALESPERSONinsert + updatevw_SAGEMASS90_SALESPERSON:SF_ERP_Salesforce_Clone_AR_SALESPERSON
vw_SAGEMASS90_CRM_ACCOUNTinsert + updatevw_SAGEMASS90_CRM_ACCOUNT:SF_ERP_Salesforce_Clone_AR_CUSTOMER
vw_SAGEMASS90_CUSTOMERinsert + updatevw_SAGEMASS90_CUSTOMER:vw_SAGEMASS90_CRM_ACCOUNT:ExternalKeySF_ERP_Salesforce_Clone_AR_CUSTOMER
vw_SAGEMASS90_SHIPTOADDRESSinsert + updatevw_SAGEMASS90_SHIPTOADDRESS:vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:ExternalKeySF_ERP_Salesforce_Clone_SO_SHIPTOADDRESS
vw_SAGEMASS90_SALESORDERHEADERinsert + updatevw_SAGEMASS90_SALESORDERHEADER:vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:SF_ERP_Salesforce_Clone_SO_SALESORDERHEADER, CommercientFlags
vw_SAGEMASS90_SALESORDERDETAILinsert + updatevw_SAGEMASS90_SALESORDERDETAIL:vw_SAGEMASS90_SALESORDERHEADER:ExternalKeySF_ERP_Salesforce_Clone_SO_SALESORDERDETAIL
vw_SAGEMASS90_INVOICEHISTORYHEADERinsert + updatevw_SAGEMASS90_INVOICEHISTORYHEADER:vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:ExternalKeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, CommercientFlags, SF_ERP_Salesforce_Clone_AR_OPENINVOICE, SF_ERP_Salesforce_Clone_AR_SALESPERSON
vw_SAGEMASS90_INVOICEHISTORYDETAILinsert + updatevw_SAGEMASS90_INVOICEHISTORYDETAIL:vw_SAGEMASS90_INVOICEHISTORYHEADER:ExternalKeySF_ERP_Salesforce_Clone_AR_INVOICEHISTORYDETAIL
vw_SAGEMASS90_TRANSACTIONPAYMENTHISTORYinsert + updatevw_SAGEMASS90_TRANSACTIONPAYMENTHISTORY:vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:, vw_SAGEMASS90_INVOICEHISTORYHEADER:ExternalKeySF_ERP_Salesforce_Clone_AR_TRANSACTIONPAYMENTHISTORY, SF_ERP_Salesforce_Clone_AR_INVOICEHISTORYHEADER, CommercientFlags

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

  • 0 — GET USER
  • 1 — SYNC SALESPERSON
  • 2 — CRM Account
  • 3 — Sage Customer
  • 5 — Sage Ship To Address
  • 12 — Sage SalesOrder Header
  • 13 — Sage SalesOrder Detail
  • 14 — Sage Invoice History Header
  • 15 — Sage Invoice History Detail
  • 16 — Sage Transaction Payment History

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_SAGEMASS90_TRANSACTIONPAYMENTHISTORY reads vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:, vw_SAGEMASS90_INVOICEHISTORYHEADER:
  • vw_SAGEMASS90_CUSTOMER reads vw_SAGEMASS90_CRM_ACCOUNT:
  • vw_SAGEMASS90_SHIPTOADDRESS reads vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:
  • vw_SAGEMASS90_INVOICEHISTORYHEADER reads vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:
  • vw_SAGEMASS90_INVOICEHISTORYDETAIL reads vw_SAGEMASS90_INVOICEHISTORYHEADER:
  • vw_SAGEMASS90_SALESORDERHEADER reads vw_SAGEMASS90_CRM_ACCOUNT:, vw_SAGEMASS90_CUSTOMER:
  • vw_SAGEMASS90_SALESORDERDETAIL reads vw_SAGEMASS90_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
SYNC SALESPERSONCommercientSF8__SAGE100_SalesPerson__c26Sales_ManagerCommercientSF8__Sales_Manager__c, SALESPERSONDIVISIONNOCommercientSF8__SALESPERSONDIVISIONNO__c, SALESPERSONNOCommercientSF8__SALESPERSONNO__c, SALESPERSONNAMECommercientSF8__SALESPERSONNAME__c, ADDRESSLINE1CommercientSF8__ADDRESSLINE1__c
CRM Accountaccount12ARDIVISIONNO, CUSTOMERNOCommercientSF__Commercient_ArCustomerCode__c, CUSTOMERNAME, CUSTOMERNOName, ADDRESSLINE1, ADDRESSLINE2, ADDRESSLINE3BillingStreet, CITYBillingCity, STATEBillingState
Sage CustomerCommercientSF8__AR_CUSTOMER__c75ARDIVISIONNO,CUSTOMERNOCommercientSF8__ExternalKey__c, CUSTOMERNAMECommercientSF8__Name__c, ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, ADDRESSLINE1CommercientSF8__ADDRESSLINE1__c
Sage Ship To AddressCommercientSF8__SO_SHIPTOADDRESS__c33ARDIVISIONNO, CUSTOMERNO, SHIPTOCODECommercientSF8__ExternalKey__c, ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, SHIPTOCODECommercientSF8__SHIPTOCODE__c, SHIPTONAMECommercientSF8__SHIPTONAME__c
Sage SalesOrder HeaderCommercientSF8__SO_SALESORDERHEADER__c132SALESORDERNOCommercientSF8__SALESORDERNO__c, ORDERDATECommercientSF8__ORDERDATE__c, ORDERTYPECommercientSF8__ORDERTYPE__c, ORDERSTATUSCommercientSF8__ORDERSTATUS__c, MASTERREPEATINGORDERNOCommercientSF8__MASTERREPEATINGORDERNO__c
Sage SalesOrder DetailCommercientSF8__SO_SALESORDERDETAIL__c64SALESORDERNO, LINEKEYCommercientSF8__ExternalKey__c, SALESORDERNOCommercientSF8__SALESORDERNO__c, LINEKEYCommercientSF8__LINEKEY__c, LINESEQNOCommercientSF8__LINESEQNO__c, ITEMCODECommercientSF8__ITEMCODE__c
Sage Invoice History HeaderCommercientSF8__AR_INVOICEHISTORYHEADER__c119INVOICENO, HEADERSEQNOCommercientSF8__ExternalKey__c, INVOICENOCommercientSF8__INVOICENO__c, HEADERSEQNOCommercientSF8__HEADERSEQNO__c, MODULECODECommercientSF8__MODULECODE__c, INVOICETYPECommercientSF8__INVOICETYPE__c
Sage Invoice History DetailCommercientSF8__AR_INVOICEHISTORYDETAIL__c57INVOICENO, HEADERSEQNO, DETAILSEQNOCommercientSF8__ExternalKey__c, INVOICENOCommercientSF8__INVOICENO__c, HEADERSEQNOCommercientSF8__HEADERSEQNO__c, DETAILSEQNOCommercientSF8__DETAILSEQNO__c, ITEMCODECommercientSF8__ITEMCODE__c
Sage Transaction Payment HistoryCommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__c30ARDIVISIONNOCommercientSF8__ARDIVISIONNO__c, CUSTOMERNOCommercientSF8__CUSTOMERNO__c, INVOICENOCommercientSF8__INVOICENO__c, INVOICETYPECommercientSF8__INVOICETYPE__c, INVOICEHISTORYHEADERSEQNOCommercientSF8__INVOICEHISTORYHEADERSEQNO__c

6. Community templates

The catalogue carries 50 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: 50
  • Default operations: insert on 50, update on 50, delete on 50
  • Marked circular-sync: 0
  • Licence groups they span: 12
  • Destination objects: CommercientSF8__SO_SALESORDERDETAIL__c, CommercientSF8__SO_SALESORDERHEADER__c, PriceBookEntry, Product2, CommercientSF8__SAGE100_CI_Item__c, ACCOUNT, CommercientSF8__AR_CUSTOMER__c, CommercientSF8__AR_INVOICEHISTORYDETAIL__c, CommercientSF8__AR_INVOICEHISTORYHEADER__c, CommercientSF8__AR_TRANSACTIONPAYMENTHISTORY__c, CommercientSF8__SAGE100_AP_VENDOR__c, CommercientSF8__SAGE100_PO_PURCHASEORDERDETAIL__c, CommercientSF8__SAGE100_PO_PURCHASEORDERHEADER__c, CommercientSF8__SO_SHIPTOADDRESS__c, Account, CASE, CommercientSF8__PRIMARYVENDORNO__c, CommercientSF8__Sage100_Invoice_Tracking_History__c, CommercientSF8__SAGE100_ItemWarehouse__c, CommercientSF8__SAGE100_SALESORDERHISTORYDETAIL__c, 4 more and 2 custom objects
  • Object display names: AR_CUSTOMER, CI Item to Vendor lookup, Get Account, GET CASE, Get So_Salesorderheader, Invoice Details, Invoice Header, Invoice Tracking History, PriceBookEntry Create, PriceBookEntry Update, Product Reverse Lookup, Purchase Order, 29 more and 9 further templates
  • Template groups: Product, Salesorder, Account, Purchase Order, Customer Multi Ship Addresses, Invoice, Invoice History Headers

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_SAGEMASS90_User
  • vw_SAGEMASS90_CRM_ACCOUNT
  • vw_SAGEMASS90_TRANSACTIONPAYMENTHISTORY
  • vw_SAGEMASS90_CUSTOMER
  • vw_SAGEMASS90_SHIPTOADDRESS
  • vw_SAGEMASS90_INVOICEHISTORYHEADER
  • vw_SAGEMASS90_INVOICEHISTORYDETAIL
  • vw_SAGEMASS90_SALESORDERHEADER
  • vw_SAGEMASS90_SALESORDERDETAIL
  • vw_SAGEMASS90_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 Sage MAS 90 → 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.