Source ERP · 103 of 105

CRMPro → Salesforce — VAI S2K: what the shipped templates set up

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

CRMPro → Salesforce — VAI S2K: 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/vai-s2k.md, and that skill’s ERP table is what points at it. What follows is only what the shipped VAI S2K → 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
VCMENOT SyncERP VCMENOT data becomes VCMENOT__c in Salesforce. New records are created and existing ones updated; none are deleted.VCMENOT__cSF_ERP_Salesforce_Clone_VCMENOT
VCNENOT SyncERP VCNENOT data becomes VCNENOT__c in Salesforce. New records are created and existing ones updated; none are deleted.VCNENOT__cSF_ERP_Salesforce_Clone_VCNENOT
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, Contact, Commercient36__VARCUST__cSF_ERP_Salesforce_Clone_VARCUST, SF_ERP_Salesforce_Clone_VARSHIP, SF_ERP_Salesforce_Clone_VCRPROS, SF_ERP_Salesforce_Clone_VXACNAD, SF_ERP_Salesforce_Clone_VXACNTC
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.Commercient36__VARSHIP__cSF_ERP_Salesforce_Clone_VARSHIP
ProductERP VINITEM, VINLOC, VINITMB data becomes VINITEM__c, VINLOC__c, VINITMB__c in Salesforce. New records are created and existing ones updated; none are deleted.VINITEM__c, VINLOC__c, VINITMB__c, Product2SF_ERP_Salesforce_Clone_VINITEM, SF_ERP_Salesforce_Clone_VINLOC, SF_ERP_Salesforce_Clone_VINITMB
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.Commercient36__VCOHEAD__c, Commercient36__VCODETL__cSF_ERP_Salesforce_Clone_VCOHEAD, SF_ERP_Salesforce_Clone_VCODETL

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
AccountAccountCommercientSF__Commercient_ArCustomerCode__c1vw_Accountvw_VAIS2K_Account'' / ''
ContactContactExternalKey__c2vw_Contactvw_VAIS2K_Contact'' / ''
CustomerCommercient36__VARCUST__cCommercient36__ExternalKey__c3vw_Customervw_VAIS2K_CustomerCommercient36__ / __c
Account To Customer Reverse LookupAccountCommercientSF__Commercient_ArCustomerCode__c4vw_CustomerToAccountLookupvw_VAIS2K_CustomerToAccountLookup'' / ''
ShipToAddressCommercient36__VARSHIP__cCommercient36__ExternalKey__c5vw_ShipToAddressvw_VAIS2K_ShipToAddressCommercient36__ / __c
SalesOrderHeaderCommercient36__VCOHEAD__cCommercient36__ExternalKey__c6vw_SalesOrderHeadervw_VAIS2K_SalesOrderHeaderCommercient36__ / __c
SalesOrderDetailCommercient36__VCODETL__cCommercient36__ExternalKey__c7vw_SalesOrderDetailvw_VAIS2K_SalesOrderDetailCommercient36__ / __c
ProductProduct2CommercientSF__ExternalKey__c8vw_Productvw_VAIS2K_Product'' / ''
ItemVINITEM__cExternalKey__c9vw_Itemvw_VAIS2K_Item'' / __c
Product To Item Reverse LookupProduct2CommercientSF__ExternalKey__c10vw_ProductToItemMasterLookupvw_VAIS2K_ProductToItemMasterLookup'' / ''
WarehouseVINLOC__cExternalKey__c11vw_Warehousevw_VAIS2K_Warehouse'' / __c
Item WarehouseVINITMB__cExternalKey__c12vw_ItemWarehousevw_VAIS2K_ItemWarehouse'' / __c
VCMENOT SyncVCMENOT__cExternalKey__c15vw_VCMENOTvw_VAIS2K_VCMENOT'' / __c
VCNENOT SyncVCNENOT__cExternalKey__c16vw_VCNENOTvw_VAIS2K_VCNENOT'' / __c
Prospect AccountAccountCommercientSF__Commercient_ArCustomerCode__c17vw_ProspectAccountvw_VAIS2K_ProspectAccount'' / ''
Prospect ContactContactExternalKey__c18vw_ProspectContactvw_VAIS2K_ProspectContact'' / ''

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 prefixesSource tables
vw_VAIS2K_Accountinsert + updatevw_Account:SF_ERP_Salesforce_Clone_VARCUST, SF_ERP_Salesforce_Clone_VARSHIP
vw_VAIS2K_Contactinsert + updatevw_Contact:vw_Account:SF_ERP_Salesforce_Clone_VARCUST, SF_ERP_Salesforce_Clone_VXACNAD, SF_ERP_Salesforce_Clone_VXACNTC, SF_ERP_Salesforce_Clone_VARSHIP
vw_VAIS2K_Customerinsert + updatevw_Customer:vw_Account:SF_ERP_Salesforce_Clone_VARCUST
vw_VAIS2K_CustomerToAccountLookupinsert + updatevw_CustomerToAccountLookup:vw_Customer:SF_ERP_Salesforce_Clone_VARCUST
vw_VAIS2K_ShipToAddressinsert + updatevw_ShipToAddress:vw_Account:, vw_Customer:SF_ERP_Salesforce_Clone_VARSHIP
vw_VAIS2K_SalesOrderHeaderinsert + updatevw_SalesOrderHeader:vw_Account:, vw_Customer:SF_ERP_Salesforce_Clone_VCOHEAD
vw_VAIS2K_SalesOrderDetailinsert + updatevw_SalesOrderDetail:vw_SalesOrderHeader:SF_ERP_Salesforce_Clone_VCODETL
vw_VAIS2K_Productinsert + updatevw_Product:SF_ERP_Salesforce_Clone_VINITEM
vw_VAIS2K_Iteminsert + updatevw_Item:vw_Product:SF_ERP_Salesforce_Clone_VINITEM
vw_VAIS2K_ProductToItemMasterLookupinsert + updatevw_ProductToItemMasterLookup:vw_Item:SF_ERP_Salesforce_Clone_VINITEM
vw_VAIS2K_Warehouseinsert + updatevw_Warehouse:SF_ERP_Salesforce_Clone_VINLOC
vw_VAIS2K_ItemWarehouseinsert + updatevw_ItemWarehouse:vw_Product:, vw_Item:, vw_Warehouse:SF_ERP_Salesforce_Clone_VINITMB
vw_VAIS2K_VCMENOTinsert + updatevw_VCMENOT:vw_Account:, vw_Customer:SF_ERP_Salesforce_Clone_VCMENOT
vw_VAIS2K_VCNENOTinsert + updatevw_VCNENOT:vw_Account:, vw_Customer:SF_ERP_Salesforce_Clone_VCNENOT
vw_VAIS2K_ProspectAccountinsert + updatevw_ProspectAccount:SF_ERP_Salesforce_Clone_VCRPROS
vw_VAIS2K_ProspectContactinsert + updatevw_ProspectContact:vw_ProspectAccount:SF_ERP_Salesforce_Clone_VCRPROS, SF_ERP_Salesforce_Clone_VXACNAD, SF_ERP_Salesforce_Clone_VXACNTC

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

  • 1 — Account
  • 2 — Contact
  • 3 — Customer
  • 4 — Account To Customer Reverse Lookup
  • 5 — ShipToAddress
  • 6 — SalesOrderHeader
  • 7 — SalesOrderDetail
  • 8 — Product
  • 9 — Item
  • 10 — Product To Item Reverse Lookup
  • 11 — Warehouse
  • 12 — Item Warehouse
  • 15 — VCMENOT Sync
  • 16 — VCNENOT Sync
  • 17 — Prospect Account
  • 18 — Prospect Contact

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_VAIS2K_VCMENOT reads vw_Account:, vw_Customer:
  • vw_VAIS2K_VCNENOT reads vw_Account:, vw_Customer:
  • vw_VAIS2K_CustomerToAccountLookup reads vw_Customer:
  • vw_VAIS2K_Contact reads vw_Account:
  • vw_VAIS2K_ProspectContact reads vw_ProspectAccount:
  • vw_VAIS2K_Customer reads vw_Account:
  • vw_VAIS2K_ShipToAddress reads vw_Account:, vw_Customer:
  • vw_VAIS2K_Item reads vw_Product:
  • vw_VAIS2K_ItemWarehouse reads vw_Product:, vw_Item:, vw_Warehouse:
  • vw_VAIS2K_ProductToItemMasterLookup reads vw_Item:
  • vw_VAIS2K_SalesOrderHeader reads vw_Account:, vw_Customer:
  • vw_VAIS2K_SalesOrderDetail reads vw_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
AccountAccount14RMCMP,RMCUSTCommercientSF__Commercient_ArCustomerCode__c, RMNAMEName, RMMFONPhone, RMCPType, RMADD1,RMADD2,RMADD3BillingStreet
CustomerCommercient36__VARCUST__c10RMCMP, RMCUSTCommercient36__ExternalKey__c, RMNAMEName, RMADD1, RMADD2, RMADD3BillingStreet, RMCITYBillingCity, RMSTATBillingState
Account To Customer Reverse LookupAccount2RMCMP, RMCUSTCommercientSF__Commercient_ArCustomerCode__c, SFDCIDCommercient36__VAIS2K_Customer_Master__c
ShipToAddressCommercient36__VARSHIP__c90RVCMP, RVCUST, RVSHIPCommercient36__ExternalKey__c, RVCMP, RVCUSTCommercient36__Account__c, RVCMP, RVCUSTCommercient36__VAIS2K_Customer_Master__c, RVNAMEName, RVDELCommercient36__RVDEL__c
SalesOrderHeaderCommercient36__VCOHEAD__c99OACMP, OAORD, OABOCDCommercient36__ExternalKey__c, OACMP, OACUSTCommercient36__Account__c, OACMP, OACUSTCommercient36__VAIS2K_Customer_Master__c, OACMP, OAORD, OABOCDName, OADELCommercient36__OADEL__c
SalesOrderDetailCommercient36__VCODETL__c97OBCMP, OBORD, OBBOCD, OBLINEExternalKey, OBCMP, OBORD, OBBOCD, OBLINEName, OBDELOBDEL, OBCMPOBCMP, OBORDOBORD
ProductProduct25ICCMP, ICITEMCommercientSF__ExternalKey__c, ICITEMProductCode, ICDSC1, ICDSC2, ICDSC3Description, ICDSC1, ICDSC2, ICDSC3, ICITEMName
ItemVINITEM__c99ICCMP, ICITEMExternalKey__c, SFDCIDProduct__c, ICDSC1, ICDSC2, ICDSC3, ICITEMName, ICDELICDEL__c, ICCMPICCMP__c
Product To Item Reverse LookupProduct22ICCMP, ICITEMCommercientSF__ExternalKey__c, SFDCIDVAIS2K_Item_Master__c
WarehouseVINLOC__c99IACMP, IALOCExternalKey__c, IACMP, IALOC, IANAMEName, IADELIADEL, IACMPIACMP, IALOCIALOC
Item WarehouseVINITMB__c101IFDEL, IFCOMP, IFLOC, IFITEMExternalKey__c, IFCOMP, IFITEMProduct__c, IFCOMP, IFITEMVAIS2K_Item_Master__c, IFCOMP, IFLOCVAIS2K_Warehouse__c, IFDEL, IFCOMP, IFLOC, IFITEMName
VCMENOT SyncVCMENOT__c27CCCMP, CCCUST, CCDATE, CCTIME, CCNOT1, CCNOT2, CCNOT3ExternalKey__c, CCCMP, CCCUSTAccount, CCCMP, CCCUSTVAIS2K_Customer_Master, CCCMP, CCCUST, CCDATE, CCTIMEName, CCDELCCDEL
VCNENOT SyncVCNENOT__c27CCCMP, CCCUST, CCDATE, CCTIME, CCNOT1ExternalKey__c, CCCMP, CCCUSTAccount, CCCMP, CCCUSTVAIS2K_Customer_Master, CCCMP, CCCUST, CCDATE, CCTIMEName, CCDELCCDEL
Prospect AccountAccount14CPCMP, CPPROSCommercientSF__Commercient_ArCustomerCode__c, CPNAMEName, CPMFONPhone, TypeType, CPADD1, CPADD2, CPADD3BillingStreet

6. Community templates

The catalogue carries 68 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: 68
  • Default operations: insert on 68, update on 68, delete on 68
  • Marked circular-sync: 7
  • Licence groups they span: 14
  • Destination objects: Account, Contact, Order, Pricebookentry, Product2, OrderItem, Commercient36__VARSHIP__c, Commercient36__VARCUST__c, Commercient36__VCODETL__c, Commercient36__VCOHEAD__c, Quote, QuoteLineItem, Commercient36_Division__c, Commercient36_Division_Class__c, Commercient36_SalesOrderHistoryDetail__c, Commercient36_SalesOrderHistoryHeader__c, Commercient36_SalesPerson__c, Commercient36_VINITEM__c, Commercient36_VINITMB__c, Commercient36_VINLOC__c, 10 more and 6 custom objects
  • Object display names: Account, Account To Customer Reverse Lookup, Contact, Customer, Item, Item Warehouse, Product, Product To Item Reverse Lookup, SalesOrderDetail, SalesOrderHeader, ShipToAddress, Standard Pricebook Create, 28 more and 15 further templates
  • Template groups: Account, Product, CRM Order and Line, Salesorder, CRM Quote and Line, Customer Multi Ship Addresses, CRM Opportunity and Line, Opportunity

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_VCMENOT
  • vw_VCNENOT
  • vw_Account
  • vw_CustomerToAccountLookup
  • vw_ProspectAccount
  • vw_Contact
  • vw_ProspectContact
  • vw_Customer
  • vw_ShipToAddress
  • vw_Item
  • vw_Warehouse
  • vw_ItemWarehouse
  • vw_Product
  • vw_ProductToItemMasterLookup
  • vw_SalesOrderHeader
  • vw_SalesOrderDetail

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 VAI S2K → 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.