Source ERP · 21 of 27

CRMPro → Zoho CRM — Sage 50 Canada: what the shipped templates set up

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

CRMPro → Zoho CRM — Sage 50 Canada: 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-zohocrm is the destination skill this page is a child of, and the authority for the Zoho CRM 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-zohocrm/erps/sage-50-canada.md, and that skill’s ERP table is what points at it. What follows is only what the shipped Sage 50 Canada → Zoho CRM 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
SAGE50CA SalespersonThe templates push commercientsage50ca__SAGE50CA_Salesperson to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_SalespersonSF_ERP_Salesforce_Clone_temp
AccountThe templates push Accounts to Zoho CRM. New records are created and existing ones updated; none are deleted.AccountsSF_ERP_Salesforce_Clone_tcustomr, SF_ERP_Salesforce_Clone_tcustshp
SAGE50CA CustomerThe templates push commercientsage50ca__SAGE50CA_Customer to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_CustomerSF_ERP_Salesforce_Clone_tcustomr
SAGE50CA CustomerToAccountLookupThe templates push Accounts to Zoho CRM. New records are created and existing ones updated; none are deleted.AccountsSF_ERP_Salesforce_Clone_tcustomr
SAGE50CA ShipToAddressThe templates push commercientsage50ca__SAGE50CA_ShipToAddress to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_ShipToAddressSF_ERP_Salesforce_Clone_tcustshp
ProductThe templates push Products to Zoho CRM. New records are created and existing ones updated; none are deleted.ProductsSF_ERP_Salesforce_Clone_tinvent
SAGE50CA ItemThe templates push commercientsage50ca__SAGE50CA_Item to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_ItemSF_ERP_Salesforce_Clone_tinvent
SAGE50CA ItemToProductLookupThe templates push Products to Zoho CRM. New records are created and existing ones updated; none are deleted.ProductsSF_ERP_Salesforce_Clone_tinvent
SAGE50CA ItemWarehouseThe templates push commercientsage50ca__SAGE50CA_ItemWarehouse to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_ItemWarehouseSF_ERP_Salesforce_Clone_tinvbyln
SAGE50CA SalessOrderHeaderThe templates push commercientsage50ca__SAGE50CA_SOHeader to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_SOHeaderSF_ERP_Salesforce_Clone_tsalordr
SAGE50CA SalessOrderDetailThe templates push commercientsage50ca__SAGE50CA_SODetail to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_SODetailSF_ERP_Salesforce_Clone_tsoline, SF_ERP_Salesforce_Clone_tsalordr
SAGE50CA InvoiceHeaderThe templates push commercientsage50ca__SAGE50CA_InvoiceHeader to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_InvoiceHeaderSF_ERP_Salesforce_Clone_titlu, SF_ERP_Salesforce_Clone_tcustomr
SAGE50CA InvoiceDetailThe templates push commercientsage50ca__SAGE50CA_InvoiceDetail to Zoho CRM. New records are created and existing ones updated; none are deleted.commercientsage50ca__SAGE50CA_InvoiceDetailSF_ERP_Salesforce_Clone_titluli, SF_ERP_Salesforce_Clone_tinvent

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
SAGE50CA Salespersoncommercientsage50ca__SAGE50CA_SalespersonCommercient_ExternalKey1vw_SAGE50CA_Salesperson:vw_SAGE50CA_Salespersoncommercientsage50ca__ / __c
AccountAccountsCommercient_ArCustomer_Code2vw_SAGE50CA_Account:vw_SAGE50CA_Account'' / ''
SAGE50CA Customercommercientsage50ca__SAGE50CA_CustomerCommercient_ExternalKey3vw_SAGE50CA_Customer:vw_SAGE50CA_Customercommercientsage50ca__ / __c
SAGE50CA CustomerToAccountLookupAccountsCommercient_ArCustomer_Code4vw_SAGE50CA_CustomerToAccountLookup:vw_SAGE50CA_CustomerToAccountLookup'' / ''
SAGE50CA ShipToAddresscommercientsage50ca__SAGE50CA_ShipToAddressCommercient_ExternalKey5vw_SAGE50CA_ShipToAddress:vw_SAGE50CA_ShipToAddresscommercientsage50ca__ / __c
ProductProductsCommercient_ExternalKey6vw_SAGE50CA_Product:vw_SAGE50CA_Product'' / ''
SAGE50CA Itemcommercientsage50ca__SAGE50CA_ItemCommercient_ExternalKey7vw_SAGE50CA_Item:vw_SAGE50CA_Itemcommercientsage50ca__ / __c
SAGE50CA ItemToProductLookupProductsCommercient_ExternalKey8vw_SAGE50CA_ItemToProductLookup:vw_SAGE50CA_ItemToProductLookup'' / ''
SAGE50CA ItemWarehousecommercientsage50ca__SAGE50CA_ItemWarehouseCommercient_ExternalKey9vw_SAGE50CA_ItemWarehouse:vw_SAGE50CA_ItemWarehousecommercientsage50ca__ / __c
SAGE50CA SalessOrderHeadercommercientsage50ca__SAGE50CA_SOHeaderCommercient_ExternalKey10vw_SAGE50CA_SalessOrderHeader:vw_SAGE50CA_SalessOrderHeadercommercientsage50ca__ / __c
SAGE50CA SalessOrderDetailcommercientsage50ca__SAGE50CA_SODetailCommercient_ExternalKey11vw_SAGE50CA_SalessOrderDetail:vw_SAGE50CA_SalessOrderDetailcommercientsage50ca__ / __c
SAGE50CA InvoiceHeadercommercientsage50ca__SAGE50CA_InvoiceHeaderCommercient_ExternalKey12vw_SAGE50CA_InvoiceHeader:vw_SAGE50CA_InvoiceHeadercommercientsage50ca__ / __c
SAGE50CA InvoiceDetailcommercientsage50ca__SAGE50CA_InvoiceDetailCommercient_ExternalKey13vw_SAGE50CA_InvoiceDetail:vw_SAGE50CA_InvoiceDetailcommercientsage50ca__ / __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. The insert column lists do not include Sync_Operation_Type, Sync_Batch_Size, IsAccountMatching, 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.

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_SAGE50CA_Salespersoninsert-onlyvw_SAGE50CA_Salesperson:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_temp
vw_SAGE50CA_Accountinsert-onlyvw_SAGE50CA_SalesPerson:, vw_SAGE50CA_Account:Commercient_ArCustomer_CodeSF_ERP_Salesforce_Clone_tcustomr, SF_ERP_Salesforce_Clone_tcustshp
vw_SAGE50CA_Customerinsert-onlyvw_SAGE50CA_Account:, vw_SAGE50CA_Customer:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tcustomr
vw_SAGE50CA_CustomerToAccountLookupinsert + updatevw_SAGE50CA_Customer:, vw_SAGE50CA_CustomerToAccountLookup:SF_ERP_Salesforce_Clone_tcustomr
vw_SAGE50CA_ShipToAddressinsert-onlyvw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_ShipToAddress:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tcustshp
vw_SAGE50CA_Productinsert-onlyvw_SAGE50CA_Product:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tinvent
vw_SAGE50CA_Iteminsert-onlyvw_SAGE50CA_Product:, vw_SAGE50CA_Item:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tinvent
vw_SAGE50CA_ItemToProductLookupinsert + updatevw_SAGE50CA_Item:, vw_SAGE50CA_ItemToProductLookup:SF_ERP_Salesforce_Clone_tinvent
vw_SAGE50CA_ItemWarehouseinsert + updatevw_SAGE50CA_Product:, vw_SAGE50CA_Item:, vw_SAGE50CA_ItemWarehouse:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tinvbyln
vw_SAGE50CA_SalessOrderHeaderinsert + updatevw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_SalessOrderHeader:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tsalordr
vw_SAGE50CA_SalessOrderDetailinsert + updatevw_SAGE50CA_SalessOrderHeader:, vw_SAGE50CA_Item:, vw_SAGE50CA_SalessOrderDetail:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_tsoline, SF_ERP_Salesforce_Clone_tsalordr
vw_SAGE50CA_InvoiceHeaderinsert + updatevw_SAGE50CA_Account:, vw_SAGE50CA_InvoiceHeader:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_titlu, SF_ERP_Salesforce_Clone_tcustomr
vw_SAGE50CA_InvoiceDetailinsert + updatevw_SAGE50CA_InvoiceHeader:, vw_SAGE50CA_Product:, vw_SAGE50CA_InvoiceDetail:Commercient_ExternalKey__c, Commercient_ExternalKeySF_ERP_Salesforce_Clone_titluli, SF_ERP_Salesforce_Clone_tinvent

4. Order of work

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

  • 1 — SAGE50CA Salesperson
  • 2 — Account
  • 3 — SAGE50CA Customer
  • 4 — SAGE50CA CustomerToAccountLookup
  • 5 — SAGE50CA ShipToAddress
  • 6 — Product
  • 7 — SAGE50CA Item
  • 8 — SAGE50CA ItemToProductLookup
  • 9 — SAGE50CA ItemWarehouse
  • 10 — SAGE50CA SalessOrderHeader
  • 11 — SAGE50CA SalessOrderDetail
  • 12 — SAGE50CA InvoiceHeader
  • 13 — SAGE50CA InvoiceDetail

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_SAGE50CA_Salesperson reads vw_SAGE50CA_Salesperson:; no template in this set writes vw_SAGE50CA_Salesperson:
  • vw_SAGE50CA_Account reads vw_SAGE50CA_SalesPerson:, vw_SAGE50CA_Account:; no template in this set writes vw_SAGE50CA_SalesPerson:, vw_SAGE50CA_Account:
  • vw_SAGE50CA_Customer reads vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:; no template in this set writes vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:
  • vw_SAGE50CA_CustomerToAccountLookup reads vw_SAGE50CA_Customer:, vw_SAGE50CA_CustomerToAccountLookup:; no template in this set writes vw_SAGE50CA_Customer:, vw_SAGE50CA_CustomerToAccountLookup:
  • vw_SAGE50CA_ShipToAddress reads vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_ShipToAddress:; no template in this set writes vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_ShipToAddress:
  • vw_SAGE50CA_Product reads vw_SAGE50CA_Product:; no template in this set writes vw_SAGE50CA_Product:
  • vw_SAGE50CA_Item reads vw_SAGE50CA_Product:, vw_SAGE50CA_Item:; no template in this set writes vw_SAGE50CA_Product:, vw_SAGE50CA_Item:
  • vw_SAGE50CA_ItemToProductLookup reads vw_SAGE50CA_Item:, vw_SAGE50CA_ItemToProductLookup:; no template in this set writes vw_SAGE50CA_Item:, vw_SAGE50CA_ItemToProductLookup:
  • vw_SAGE50CA_ItemWarehouse reads vw_SAGE50CA_Product:, vw_SAGE50CA_Item:, vw_SAGE50CA_ItemWarehouse:; no template in this set writes vw_SAGE50CA_Product:, vw_SAGE50CA_Item:, vw_SAGE50CA_ItemWarehouse:
  • vw_SAGE50CA_SalessOrderHeader reads vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_SalessOrderHeader:; no template in this set writes vw_SAGE50CA_Account:, vw_SAGE50CA_Customer:, vw_SAGE50CA_SalessOrderHeader:
  • vw_SAGE50CA_SalessOrderDetail reads vw_SAGE50CA_SalessOrderHeader:, vw_SAGE50CA_Item:, vw_SAGE50CA_SalessOrderDetail:; no template in this set writes vw_SAGE50CA_SalessOrderHeader:, vw_SAGE50CA_Item:, vw_SAGE50CA_SalessOrderDetail:
  • vw_SAGE50CA_InvoiceHeader reads vw_SAGE50CA_Account:, vw_SAGE50CA_InvoiceHeader:; no template in this set writes vw_SAGE50CA_Account:, vw_SAGE50CA_InvoiceHeader:
  • vw_SAGE50CA_InvoiceDetail reads vw_SAGE50CA_InvoiceHeader:, vw_SAGE50CA_Product:, vw_SAGE50CA_InvoiceDetail:; no template in this set writes vw_SAGE50CA_InvoiceHeader:, vw_SAGE50CA_Product:, vw_SAGE50CA_InvoiceDetail:

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 → Zoho CRM pairs
SAGE50CA Salespersoncommercientsage50ca__SAGE50CA_Salesperson61lIdCommercient_ExternalKey__c, sNameName, lIdEmployee_ID, lAcWageExpWage_Expense_Account, lDpWageExpDepartment_ID_for_Wage_Expense_Account
AccountAccounts16lIdCommercient_ArCustomer_Code__c, sNameAccount_Name, lIdAccount_Number, sStreet1,sStreet2Billing_Street, sCityBilling_City
SAGE50CA Customercommercientsage50ca__SAGE50CA_Customer63lIdCommercient_ExternalKey__c, SFDCIDAccount_R, sNameName, bCanSaveCCCan_Save_CC, bContOnChqPrint_contact_on_check
SAGE50CA CustomerToAccountLookupAccounts2lIdCommercient_ArCustomer_Code, SFDCIDSAGE50CA_Customer
SAGE50CA ShipToAddresscommercientsage50ca__SAGE50CA_ShipToAddress20lIdCommercient_ExternalKey__c, lCustIdAccount, lCustIdSAGE50CA_Customer, sAddrNameName, lCustIdCustomer_ID
ProductProducts5lIdCommercient_ExternalKey__c, sNameProduct_Name, sPartCodeProduct_Code, sNameDescription, bInactiveProduct_Active
SAGE50CA Itemcommercientsage50ca__SAGE50CA_Item52lIdCommercient_ExternalKey__c, SFDCIDProduct__c, sNameName, bBuyAsStkBuying_units_are_same_as_stocking_units, bBuyToStkBuying_relationship_is_buying_unit_stocking_unit
SAGE50CA ItemToProductLookupProducts2lIdCommercient_ExternalKey, SFDCIDSAGE50CA_Item
SAGE50CA ItemWarehousecommercientsage50ca__SAGE50CA_ItemWarehouse15lInventId, lInvLocIdCommercient_ExternalKey__c, lInventId, lInvLocIdName, lInventIdProduct__c, lInventIdSAGE50CA_Item, lInventIdInventory_ID
SAGE50CA SalessOrderHeadercommercientsage50ca__SAGE50CA_SOHeader61lId, lCusIdCommercient_ExternalKey__c, lIdName, lCusIdAccount_R, lCusIdCustomer_R, bClearedOrder_cleared_from_the_system
SAGE50CA SalessOrderDetailcommercientsage50ca__SAGE50CA_SODetail27lSOId, nLineNumCommercient_ExternalKey__c, lSOId, nLineNumName, SFDCIDSOHeader_R, bDefBsPricBase_price_is_default_price_from_price_list, bDefPrcPrice_is_default_price_from_price_list
SAGE50CA InvoiceHeadercommercientsage50ca__SAGE50CA_InvoiceHeader37lITRecIdCommercient_ExternalKey__c, lITRecIdName, SFDCIDAccount, b40DataIs_40_Data__c, bAlocToAllIs_Alocated_to_All__c
SAGE50CA InvoiceDetailcommercientsage50ca__SAGE50CA_InvoiceDetail26lITRecId,nLineNumCommercient_ExternalKey__c, lITRecId,nLineNumName, lITRecIdInvoiceHeader_R, sItemProduct__c, bDefDescIS_Def_Desc

6. Community templates

The catalogue carries 48 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: 48
  • Default operations: insert on 48, update on 48, delete on 48
  • Marked circular-sync: 0
  • Licence groups they span: 4
  • Destination objects: Accounts, Products, commercientsage50ca__SAGE50CA_Customer, commercientsage50ca__SAGE50CA_InvoiceDetail, commercientsage50ca__SAGE50CA_InvoiceHeader, commercientsage50ca__SAGE50CA_Item, commercientsage50ca__SAGE50CA_ItemWarehouse, commercientsage50ca__SAGE50CA_Salesperson, commercientsage50ca__SAGE50CA_ShipToAddress, commercientsage50ca__SAGE50CA_SODetail, commercientsage50ca__SAGE50CA_SOHeader, users, Contacts, Price_Books, Vendors and 3 custom objects
  • Object display names: Product, SAGE50CA Customer, SAGE50CA CustomerToAccountLookup, SAGE50CA InvoiceDetail, SAGE50CA InvoiceHeader, SAGE50CA Item, SAGE50CA ItemToProductLookup, SAGE50CA ItemWarehouse, SAGE50CA Salesperson, SAGE50CA SalessOrderDetail, SAGE50CA SalessOrderHeader, SAGE50CA ShipToAddress, 10 more and a further template
  • Template groups: Account, CRM Order and Line

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_SAGE50CA_Salesperson:
  • vw_SAGE50CA_Account:
  • vw_SAGE50CA_Customer:
  • vw_SAGE50CA_CustomerToAccountLookup:
  • vw_SAGE50CA_ShipToAddress:
  • vw_SAGE50CA_Product:
  • vw_SAGE50CA_Item:
  • vw_SAGE50CA_ItemToProductLookup:
  • vw_SAGE50CA_ItemWarehouse:
  • vw_SAGE50CA_SalessOrderHeader:
  • vw_SAGE50CA_SalessOrderDetail:
  • vw_SAGE50CA_InvoiceHeader:
  • vw_SAGE50CA_InvoiceDetail:

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 50 Canada → Zoho CRM templates set up. dlake-crmpro-zohocrm is the destination skill this page sits under: its own text is the authority for the Zoho CRM 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.