Source ERP · 84 of 105

CRMPro → Salesforce — Sage 300 CRE: what the shipped templates set up

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

CRMPro → Salesforce — Sage 300 CRE: 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-300-cre.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Sage 300 CRE → 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
ACTIVE CNC_CONTRACTThe templates push CommercientSF8__ACTIVE_CNC_CONTRACT__c to Salesforce. New records are created and existing ones updated; none are deleted.CommercientSF8__ACTIVE_CNC_CONTRACT__cSF_ERP_Salesforce_Clone_ACTIVE_CNC_CONTRACT
MASTER_JCM_JOB_1The templates push CommercientSF8__MASTER_JCM_JOB_1__c to Salesforce. New records are created and existing ones updated; none are deleted.CommercientSF8__MASTER_JCM_JOB_1__cSF_ERP_Salesforce_Clone_MASTER_JCM_JOB_1
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, Contact, CommercientSF8__Master_ARM_Customer__cSF_ERP_Salesforce_Clone_Master_ARM_Customer, SF_ERP_Salesforce_Clone_SERVICESITE
ProductThe templates push CommercientSF8__ACTIVE_CNC_CONTRACT_ITEM__c, CommercientSF8__BILLED_BLI_ITEM__c to Salesforce. New records are created and existing ones updated; none are deleted.CommercientSF8__ACTIVE_CNC_CONTRACT_ITEM__c, CommercientSF8__BILLED_BLI_ITEM__cSF_ERP_Salesforce_Clone_ACTIVE_CNC_CONTRACT_ITEM, SF_ERP_Salesforce_Clone_BILLED_BLI_ITEM
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__BILLED_BLI_INVOICE__cSF_ERP_Salesforce_Clone_BILLED_BLI_INVOICE
Open AR Invoice HeaderBoth 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__Current_ART_Transaction__cSF_ERP_Salesforce_Clone_Current_ART_Transaction, 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
ACCOUNTAccountCommercientSF__Commercient_ArCustomerCode__c1vw_SAGE300CRE_Accountvw_SAGE300CRE_Account'' / ''
CUSTOMERCommercientSF8__Master_ARM_Customer__cCommercientSF8__ExternalKey__c2vw_SAGE300CRE_Master_ARM_Customervw_SAGE300CRE_Master_ARM_CustomerCommercientSF8__ / __c
Customer Account Reverse LookupAccountCommercientSF__Commercient_ArCustomerCode__c3vw_SAGE300CRE_CustomerToAccountLookupvw_SAGE300CRE_CustomerToAccountLookup'' / ''
CURRENT ART_TRANSACTIONCommercientSF8__Current_ART_Transaction__cCommercientSF8__ExternalKey__c4vw_SAGE300CRE_Current_ART_Transactionvw_SAGE300CRE_Current_ART_TransactionCommercientSF8__ / __c
ACTIVE CNC_CONTRACTCommercientSF8__ACTIVE_CNC_CONTRACT__cCommercientSF8__ExternalKey__c5vw_SAGE300CRE_ACTIVE_CNC_CONTRACTvw_SAGE300CRE_ACTIVE_CNC_CONTRACTCommercientSF8__ / __c
MASTER_JCM_JOB_1CommercientSF8__MASTER_JCM_JOB_1__cCommercientSF8__ExternalKey__c6vw_SAGE300CRE_MASTER_JCM_JOB_1vw_SAGE300CRE_MASTER_JCM_JOB_1CommercientSF8__ / __c
ACTIVE_CNC_CONTRACT_ITEMCommercientSF8__ACTIVE_CNC_CONTRACT_ITEM__cCommercientSF8__ExternalKey__c7vw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEMvw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEMCommercientSF8__ / __c
BILLED_BLI_INVOICECommercientSF8__BILLED_BLI_INVOICE__cCommercientSF8__ExternalKey__c8vw_SAGE300CRE_BILLED_BLI_INVOICEvw_SAGE300CRE_BILLED_BLI_INVOICECommercientSF8__ / __c
BILLED_BLI_ITEMCommercientSF8__BILLED_BLI_ITEM__cCommercientSF8__ExternalKey__c9vw_SAGE300CRE_BILLED_BLI_ITEMvw_SAGE300CRE_BILLED_BLI_ITEMCommercientSF8__ / __c
SYNC CONTACTSContactCommercientSF8__ExternalKey__c12vw_SAGE300CRE_Contactvw_SAGE300CRE_Contact'' / ''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, Sync_Batch_Size 200. IsAccountMatching is set on ACCOUNT. 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.

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_SAGE300CRE_Accountinsert + updatevw_SAGE300CRE_Account:SF_ERP_Salesforce_Clone_Master_ARM_Customer
vw_SAGE300CRE_Master_ARM_Customerinsert + updatevw_SAGE300CRE_Master_ARM_Customer:vw_SAGE300CRE_Account:SF_ERP_Salesforce_Clone_Master_ARM_Customer
vw_SAGE300CRE_CustomerToAccountLookupinsert + updatevw_SAGE300CRE_CustomerToAccountLookup:vw_SAGE300CRE_Master_ARM_Customer:SF_ERP_Salesforce_Clone_Master_ARM_Customer
vw_SAGE300CRE_Current_ART_Transactioninsert + updatevw_SAGE300CRE_Current_ART_Transaction:vw_SAGE300CRE_Master_ARM_Customer:SF_ERP_Salesforce_Clone_Current_ART_Transaction, CommercientFlags
vw_SAGE300CRE_ACTIVE_CNC_CONTRACTinsert + updatevw_SAGE300CRE_ACTIVE_CNC_CONTRACT:SF_ERP_Salesforce_Clone_ACTIVE_CNC_CONTRACT
vw_SAGE300CRE_MASTER_JCM_JOB_1insert + updatevw_SAGE300CRE_MASTER_JCM_JOB_1:vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:SF_ERP_Salesforce_Clone_MASTER_JCM_JOB_1
vw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEMinsert + updatevw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEM:vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:, vw_SAGE300CRE_MASTER_JCM_JOB_1:SF_ERP_Salesforce_Clone_ACTIVE_CNC_CONTRACT_ITEM
vw_SAGE300CRE_BILLED_BLI_INVOICEinsert + updatevw_SAGE300CRE_BILLED_BLI_INVOICE:vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:ExternalKeySF_ERP_Salesforce_Clone_BILLED_BLI_INVOICE
vw_SAGE300CRE_BILLED_BLI_ITEMinsert + updatevw_SAGE300CRE_BILLED_BLI_ITEM:vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_MASTER_JCM_JOB_1:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:SF_ERP_Salesforce_Clone_BILLED_BLI_ITEM
vw_SAGE300CRE_Contactinsert + updatevw_SAGE300CRE_Contact:vw_SAGE300CRE_Account:, vw_SAGE300CRE_Account_Child:CommercientSF8__ExternalKey__cSF_ERP_Salesforce_Clone_SERVICESITE

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

  • 1 — ACCOUNT
  • 2 — CUSTOMER
  • 3 — Customer Account Reverse Lookup
  • 4 — CURRENT ART_TRANSACTION
  • 5 — ACTIVE CNC_CONTRACT
  • 6 — MASTER_JCM_JOB_1
  • 7 — ACTIVE_CNC_CONTRACT_ITEM
  • 8 — BILLED_BLI_INVOICE
  • 9 — BILLED_BLI_ITEM
  • 12 — SYNC CONTACTS

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_SAGE300CRE_MASTER_JCM_JOB_1 reads vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:
  • vw_SAGE300CRE_CustomerToAccountLookup reads vw_SAGE300CRE_Master_ARM_Customer:
  • vw_SAGE300CRE_Contact reads vw_SAGE300CRE_Account:, vw_SAGE300CRE_Account_Child:; no template in this set writes vw_SAGE300CRE_Account_Child:
  • vw_SAGE300CRE_Master_ARM_Customer reads vw_SAGE300CRE_Account:
  • vw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEM reads vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:, vw_SAGE300CRE_MASTER_JCM_JOB_1:
  • vw_SAGE300CRE_BILLED_BLI_ITEM reads vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_MASTER_JCM_JOB_1:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:
  • vw_SAGE300CRE_BILLED_BLI_INVOICE reads vw_SAGE300CRE_Account:, vw_SAGE300CRE_Master_ARM_Customer:, vw_SAGE300CRE_ACTIVE_CNC_CONTRACT:
  • vw_SAGE300CRE_Current_ART_Transaction reads vw_SAGE300CRE_Master_ARM_Customer:

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
ACCOUNTAccount12CustomerCommercientSF__Commercient_ArCustomerCode__c, CustomerName, Address_1, Address_2, Address_3, Address_4ShippingStreet, CityShippingCity, StateShippingState
CUSTOMERCommercientSF8__Master_ARM_Customer__c87CustomerCommercientSF8__ExternalKey__c, CustomerCommercientSF8__Name__c, AB_Company_IDCommercientSF8__AB_Company_ID__c, ABNCommercientSF8__ABN__c, Addon_TableCommercientSF8__Addon_Table__c
Customer Account Reverse LookupAccount2CustomerCommercientSF__Commercient_ArCustomerCode__c, SFDCIDCommercientSF8__Sage300CRE_Customer_Master__c
CURRENT ART_TRANSACTIONCommercientSF8__Current_ART_Transaction__c74Run, SequenceCommercientSF8__ExternalKey__c, Run, SequenceCommercientSF8__Name__c, Accounting_DateCommercientSF8__Accounting_Date__c, Actvty_SeqCommercientSF8__Actvty_Seq__c, AdjustmentCommercientSF8__Adjustment__c
ACTIVE CNC_CONTRACTCommercientSF8__ACTIVE_CNC_CONTRACT__c50ContractCommercientSF8__ExternalKey__c, ContractCommercientSF8__Name__c, Account_PrefixCommercientSF8__Account_Prefix__c, Add_Stored_MaterialsCommercientSF8__Add_Stored_Materials__c, Addon_TableCommercientSF8__Addon_Table__c
MASTER_JCM_JOB_1CommercientSF8__MASTER_JCM_JOB_1__c87JobCommercientSF8__ExternalKey__c, JobCommercientSF8__Name__c, Actual_Complete_DateCommercientSF8__Actual_Complete_Date__c, Actual_Start_DateCommercientSF8__Actual_Start_Date__c, Address_1CommercientSF8__Address_1__c
ACTIVE_CNC_CONTRACT_ITEMCommercientSF8__ACTIVE_CNC_CONTRACT_ITEM__c76Contract, Contract_ItemCommercientSF8__ExternalKey__c, Contract, Contract_ItemCommercientSF8__Name__c, Account_PrefixCommercientSF8__Account_Prefix__c, Accounts_Receivable_AccountCommercientSF8__Accounts_Receivable_Account__c, Approval_DateCommercientSF8__Approval_Date__c
BILLED_BLI_INVOICECommercientSF8__BILLED_BLI_INVOICE__c64InvoiceCommercientSF8__ExternalKey__c, InvoiceCommercientSF8__Name__c, Accounting_DateCommercientSF8__Accounting_Date__c, AddonCommercientSF8__Addon__c, Adjustment_to_DateCommercientSF8__Adjustment_to_Date__c
BILLED_BLI_ITEMCommercientSF8__BILLED_BLI_ITEM__c37AddonCommercientSF8__Addon__c, Addon_PercentCommercientSF8__Addon_Percent__c, Addon_TypeCommercientSF8__Addon_Type__c, AmountCommercientSF8__Amount__c, ContractCommercientSF8__Contract__c
SYNC CONTACTSContact9CommercientSF8__ExternalKeyCommercientSF8__ExternalKey__c, AccountIDAccountID, FirstNameFirstName, LastNameLastName, EmailEmail

6. Community templates

The catalogue carries 81 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: 81
  • Default operations: insert on 81, update on 81, delete on 81
  • Marked circular-sync: 0
  • Licence groups they span: 9
  • Destination objects: Account, CommercientSF8__Master_ARM_Customer__c, CommercientSF8__MASTER_JCM_JOB_1__c, CommercientSF8__ACTIVE_CNC_CONTRACT__c, CommercientSF8__ACTIVE_CNC_CONTRACT_ITEM__c, CommercientSF8__BILLED_BLI_INVOICE__c, CommercientSF8__BILLED_BLI_ITEM__c, CommercientSF8__Current_ART_Transaction__c, Contact, CommercientSF8__MASTER_JCM_JOB_2__c, Job__c, CommercientSF8__MASTER_JCM_STANDARD_COST_CODE__c, INVOICE__c, Opportunity, Production_Job__c, Project__c, Sage300CRE_MASTER_JCM_CATEGORY__c and 9 custom objects
  • Object display names: CUSTOMER, Customer Account Reverse Lookup, ACCOUNT, ACTIVE CNC_CONTRACT, ACTIVE_CNC_CONTRACT_ITEM, BILLED_BLI_INVOICE, BILLED_BLI_ITEM, MASTER_JCM_JOB_1, Contact, CURRENT ART_TRANSACTION, SYNC ACCOUNT, SYNC BILLEDBLIINVOICE, 38 more and 7 further templates
  • Template groups: Account, Product, Invoice, CRM Opportunity and Line, Salesorder

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_SAGE300CRE_ACTIVE_CNC_CONTRACT
  • vw_SAGE300CRE_MASTER_JCM_JOB_1
  • vw_SAGE300CRE_Account
  • vw_SAGE300CRE_CustomerToAccountLookup
  • vw_SAGE300CRE_Contact
  • vw_SAGE300CRE_Master_ARM_Customer
  • vw_SAGE300CRE_ACTIVE_CNC_CONTRACT_ITEM
  • vw_SAGE300CRE_BILLED_BLI_ITEM
  • vw_SAGE300CRE_BILLED_BLI_INVOICE
  • vw_SAGE300CRE_Current_ART_Transaction

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 300 CRE → 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.