Source ERP · 63 of 105

CRMPro → Salesforce — NetSuite: what the shipped templates set up

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

CRMPro → Salesforce — NetSuite: 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/netsuite.md, and that skill’s ERP table is what points at it. What follows is only what the shipped NetSuite → 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, Contact, CommercientSF13__NETSUITE_CUSTOMERS__c, CommercientSF13__NETSUITE_SalesPerson__cSF_ERP_Salesforce_Clone_CUSTOMER, SF_ERP_Salesforce_Clone_CUSTOMERADDRESSBOOK, SF_ERP_Salesforce_Clone_CONTACT, SF_ERP_Salesforce_Clone_EMPLOYEE
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.CommercientSF13__NETSUITE_CUSTOMERADDRESSBOOK__cSF_ERP_Salesforce_Clone_CUSTOMERADDRESSBOOK, SF_ERP_Salesforce_Clone_CUSTOMER
ProductERP ITEM, INVENTORYITEM, ASSEMBLYITEM data becomes CommercientSF13__NETSUITE_ITEM__c, CommercientSF13__NETSUITE_Warehouse__c, Product2 in Salesforce. New records are created and existing ones updated; none are deleted.CommercientSF13__NETSUITE_ITEM__c, CommercientSF13__NETSUITE_Warehouse__c, Product2SF_ERP_Salesforce_Clone_ITEM, SF_ERP_Salesforce_Clone_InventoryItem
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.CommercientSF13__NETSUITE_INVOICE__c, CommercientSF13__NETSUITE_INVOICEITEM__cSF_ERP_Salesforce_Clone_INVOICE, CommercientFlags, SF_ERP_Salesforce_Clone_INVOICEITEM
PricebookERP PRICELIST, ASSEMBLYITEM, NONINVENTORYRESALEITEM data becomes PriceBook2, PricebookEntry in Salesforce. New records are created and existing ones updated; none are deleted.PriceBook2, PricebookEntrySF_ERP_Salesforce_Clone_PriceList
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.CommercientSF13__NETSUITE_SALESORDER__c, CommercientSF13__NETSUITE_SALESORDERITEM__cSF_ERP_Salesforce_Clone_SALESORDER, CommercientFlags, SF_ERP_Salesforce_Clone_SALESORDERITEM

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_NETSUITE_User1=0'' / ''1
AccountAccountCommercientSF__Commercient_ArCustomerCode__c1vw_NETSUITE_Accountvw_NETSUITE_Account'' / ''1
NetSuite SalespersonCommercientSF13__NETSUITE_SalesPerson__cCommercientSF13__ExternalKey__c1vw_NETSUITE_SalesPersonvw_NETSUITE_SalesPersonCommercientSF13__ / __c1
Account-ChildAccountCommercientSF__Commercient_ArCustomerCode__c2vw_NETSUITE_Accountvw_NETSUITE_Account_Child'' / ''1
CustomerCommercientSF13__NETSUITE_CUSTOMERS__cCommercientSF13__ExternalKey__c3vw_NETSUITE_Customervw_NETSUITE_CustomerCommercientSF13__ / __c1
Customer To Account Reverse LookupAccountCommercientSF__Commercient_ArCustomerCode__c4vw_NETSUITE_CustomerToAccountLookupvw_NETSUITE_CustomerToAccountLookup'' / ''1
Customer Address BookCommercientSF13__NETSUITE_CUSTOMERADDRESSBOOK__cCommercientSF13__ExternalKey__c5vw_NETSUITE_CustomerAddressBookvw_NETSUITE_CustomerAddressBookCommercientSF13__ / __c1
SalesOrderCommercientSF13__NETSUITE_SALESORDER__cCommercientSF13__ExternalKey__c6vw_NETSUITE_SalesOrdervw_NETSUITE_SalesOrderCommercientSF13__ / __c1
salesOrder LineCommercientSF13__NETSUITE_SALESORDERITEM__cCommercientSF13__ExternalKey__c7vw_NETSUITE_SalesOrderLinevw_NETSUITE_SalesOrderLineCommercientSF13__ / __c1
InvoiceCommercientSF13__NETSUITE_INVOICE__cCommercientSF13__ExternalKey__c8vw_NETSUITE_Invoicevw_NETSUITE_InvoiceCommercientSF13__ / __c1
Invoice LineCommercientSF13__NETSUITE_INVOICEITEM__cCommercientSF13__ExternalKey__c9vw_NETSUITE_InvoiceLinevw_NETSUITE_InvoiceLineCommercientSF13__ / __c1
ContactContactExternalKey__c10vw_NETSUITE_Contactvw_NETSUITE_Contact'' / ''1
ItemCommercientSF13__NETSUITE_ITEM__cCommercientSF13__ExternalKey__c11vw_NETSUITE_Itemvw_NETSUITE_ItemCommercientSF13__ / __c1
ProductProduct2CommercientSF__ExternalKey__c12vw_NETSUITE_Productvw_NETSUITE_Product'' / ''1
ProductToItemReverseLookupCommercientSF13__NETSUITE_ITEM__cCommercientSF13__ExternalKey__c13vw_NETSUITE_ProductToItemReverseLookupvw_NETSUITE_ProductToItemReverseLookupCommercientSF13__ / __c1
Item WarehouseCommercientSF13__NETSUITE_Warehouse__cCommercientSF13__ExternalKey__c14vw_NETSUITE_ItemWarehousevw_NETSUITE_ItemWarehouseCommercientSF13__ / __c1
PriceBook2PriceBook2ExternalKey__c14vw_NETSUITE_PriceBook2vw_NETSUITE_PriceBook2'' / ''1
Create Standard PriceBookPricebookEntryExternalKey__c15vw_NETSUITE_StandardProductPriceBookvw_NETSUITE_StandardProductPriceBook_Create'' / ''1
Update Standard PriceBookPricebookEntryExternalKey__c16vw_NETSUITE_StandardProductPriceBookvw_NETSUITE_StandardProductPriceBook_Update'' / ''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. Text columns a template does not use are inserted as '' rather than left NULL. Get_SOQL_Query carries a query on GET USER, PriceBook2, Create Standard PriceBook — 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_NETSUITE_Accountinsert + updatevw_NETSUITE_Account:vw_NETSUITE_SalesPerson:, vw_NETSUITE_User:SF_ERP_Salesforce_Clone_CUSTOMER, SF_ERP_Salesforce_Clone_CUSTOMERADDRESSBOOK
vw_NETSUITE_SalesPersoninsert + updatevw_NETSUITE_SalesPerson:ExternalKeySF_ERP_Salesforce_Clone_EMPLOYEE
vw_NETSUITE_Account_Childinsert + updatevw_NETSUITE_Account:vw_NETSUITE_SalesPerson:, vw_NETSUITE_User:SF_ERP_Salesforce_Clone_CUSTOMER, SF_ERP_Salesforce_Clone_CUSTOMERADDRESSBOOK
vw_NETSUITE_Customerinsert + updatevw_NETSUITE_Customer:vw_NETSUITE_Account:ExternalKeySF_ERP_Salesforce_Clone_CUSTOMER
vw_NETSUITE_CustomerToAccountLookupinsert + updatevw_NETSUITE_CustomerToAccountLookup:vw_NETSUITE_Customer:SF_ERP_Salesforce_Clone_CUSTOMER
vw_NETSUITE_CustomerAddressBookinsert + updatevw_NETSUITE_CustomerAddressBook:vw_NETSUITE_Account:, vw_NETSUITE_Customer:ExternalKeySF_ERP_Salesforce_Clone_CUSTOMERADDRESSBOOK, SF_ERP_Salesforce_Clone_CUSTOMER
vw_NETSUITE_SalesOrderinsert + updatevw_NETSUITE_SalesOrder:vw_NETSUITE_Account:, vw_NETSUITE_Customer:ExternalKeySF_ERP_Salesforce_Clone_SALESORDER, CommercientFlags
vw_NETSUITE_SalesOrderLineinsert + updatevw_NETSUITE_SalesOrderLine:vw_NETSUITE_SalesOrder:ExternalKeySF_ERP_Salesforce_Clone_SALESORDERITEM, SF_ERP_Salesforce_Clone_SALESORDER
vw_NETSUITE_Invoiceinsert + updatevw_NETSUITE_Invoice:vw_NETSUITE_Account:, vw_NETSUITE_Customer:ExternalKeySF_ERP_Salesforce_Clone_INVOICE, CommercientFlags
vw_NETSUITE_InvoiceLineinsert + updatevw_NETSUITE_InvoiceLine:vw_NETSUITE_Invoice:ExternalKeySF_ERP_Salesforce_Clone_INVOICEITEM, SF_ERP_Salesforce_Clone_INVOICE
vw_NETSUITE_Contactinsert + updatevw_NETSUITE_Contact:vw_NETSUITE_Account:, vw_NETSUITE_Customer:ExternalKey__cSF_ERP_Salesforce_Clone_CONTACT
vw_NETSUITE_Iteminsert + updatevw_NETSUITE_Item:ExternalKeySF_ERP_Salesforce_Clone_ITEM
vw_NETSUITE_Productinsert + updatevw_NETSUITE_Product:vw_NETSUITE_Item:SF_ERP_Salesforce_Clone_ITEM
vw_NETSUITE_ProductToItemReverseLookupinsert + updatevw_NETSUITE_ProductToItemReverseLookup:vw_NETSUITE_Product:SF_ERP_Salesforce_Clone_ITEM
vw_NETSUITE_ItemWarehouseinsert + updatevw_NETSUITE_ItemWarehouse:vw_NETSUITE_Product:, vw_NETSUITE_Item:ExternalKeySF_ERP_Salesforce_Clone_InventoryItem
vw_NETSUITE_StandardProductPriceBook_Createinsert-onlyvw_NETSUITE_Product:ExternalKey__cSF_ERP_Salesforce_Clone_PriceList
vw_NETSUITE_StandardProductPriceBook_Updateinsert + updateExternalKey__cSF_ERP_Salesforce_Clone_PriceList

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 — Account, NetSuite Salesperson
  • 2 — Account-Child
  • 3 — Customer
  • 4 — Customer To Account Reverse Lookup
  • 5 — Customer Address Book
  • 6 — SalesOrder
  • 7 — salesOrder Line
  • 8 — Invoice
  • 9 — Invoice Line
  • 10 — Contact
  • 11 — Item
  • 12 — Product
  • 13 — ProductToItemReverseLookup
  • 14 — Item Warehouse, PriceBook2
  • 15 — Create Standard PriceBook
  • 16 — Update Standard PriceBook

Several of these rows share a Sync_Order value: each template group carries its own numbering, so give the imported processes an order across the whole set rather than taking the template values as one.

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_NETSUITE_Account reads vw_NETSUITE_SalesPerson:, vw_NETSUITE_User:
  • vw_NETSUITE_Account_Child reads vw_NETSUITE_SalesPerson:, vw_NETSUITE_User:
  • vw_NETSUITE_CustomerToAccountLookup reads vw_NETSUITE_Customer:
  • vw_NETSUITE_Contact reads vw_NETSUITE_Account:, vw_NETSUITE_Customer:
  • vw_NETSUITE_Customer reads vw_NETSUITE_Account:
  • vw_NETSUITE_CustomerAddressBook reads vw_NETSUITE_Account:, vw_NETSUITE_Customer:
  • vw_NETSUITE_ProductToItemReverseLookup reads vw_NETSUITE_Product:
  • vw_NETSUITE_ItemWarehouse reads vw_NETSUITE_Product:, vw_NETSUITE_Item:
  • vw_NETSUITE_Invoice reads vw_NETSUITE_Account:, vw_NETSUITE_Customer:
  • vw_NETSUITE_InvoiceLine reads vw_NETSUITE_Invoice:
  • vw_NETSUITE_StandardProductPriceBook_Create reads vw_NETSUITE_Product:
  • vw_NETSUITE_Product reads vw_NETSUITE_Item:
  • vw_NETSUITE_SalesOrder reads vw_NETSUITE_Account:, vw_NETSUITE_Customer:
  • vw_NETSUITE_SalesOrderLine reads vw_NETSUITE_SalesOrder:

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
AccountAccount15internalIdCommercientSF__Commercient_ArCustomerCode__c, entityIdName, phonePhone, addr1, addr2, addr3BillingStreet, cityBillingCity
NetSuite SalespersonCommercientSF13__NETSUITE_SalesPerson__c74accountNumberFieldaccountNumberField, defaultAddressFieldCommercientSF13__defaultAddressField__c, adpIdFieldCommercientSF13__adpIdField__c, altNameFieldCommercientSF13__altNameField__c, billPayFieldSpecifiedbillPayFieldSpecified
CustomerCommercientSF13__NETSUITE_CUSTOMERS__c145internalIdCommercientSF13__ExternalKey__c, entityIdName, SFDCIDAccount, customForminternalIdcustomForminternalIdField, customFormexternalIdcustomFormexternalIdField
Customer To Account Reverse LookupAccount2internalIdCommercientSF__Commercient_ArCustomerCode__c, SFDCIDCommercientSF13__Customer__c
Customer Address BookCommercientSF13__NETSUITE_CUSTOMERADDRESSBOOK__c22parentId,internalIdCommercientSF13__ExternalKey__c, addressee,entityIdCommercientSF13__Name__c, SFDCIDCommercientSF13__Account__c, SFDCIDCommercientSF13__Customer__c, parentIdCommercientSF13__parentIdField__c
SalesOrderCommercientSF13__NETSUITE_SALESORDER__c197internalIdCommercientSF13__ExternalKey__c, tranIdName, entityinternalIdAccount, entityinternalIdCustomer, createdDatecreatedDateField
salesOrder LineCommercientSF13__NETSUITE_SALESORDERITEM__c93internalId, lineCommercientSF13__ExternalKey__c, internalId, line, tranIdName, SFDCIDSalesorder, internalIdinternalId, jobinternalIdjobinternalId
InvoiceCommercientSF13__NETSUITE_INVOICE__c160internalIdCommercientSF13__ExternalKey__c, tranIdName, entityinternalIdAccount, entityinternalIdCustomer, createdDatecreatedDateField
Invoice LineCommercientSF13__NETSUITE_INVOICEITEM__c73internalId, lineCommercientSF13__ExternalKey__c, internalId, line, tranIdName, SFDCIDCommercientSF13__Invoice__c, internalIdinternalIdField, jobinternalIdjobinternalIdField
ProductProduct26internalIdCommercientSF__ExternalKey__c, itemIdName, itemIdProductCode, stockDescriptionDescription, isInactiveIsActive
ProductToItemReverseLookupCommercientSF13__NETSUITE_ITEM__c2internalIdCommercientSF13__ExternalKey__c, SFDCIDCommercientSF13__Product__c
PriceBook2PriceBook22ExternalKey__cExternalKey__c, NameName
Create Standard PriceBookPricebookEntry5IdExternalKey__c, SFDCIDPricebook2ID, SFDCIDProduct2ID, valueUnitPrice, IsActiveIsActive
Update Standard PriceBookPricebookEntry3IdExternalKey__c, valueUnitPrice

6. Community templates

The catalogue carries 253 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: 253
  • Default operations: insert on 253, update on 253, delete on 253
  • Marked circular-sync: 2
  • Licence groups they span: 12
  • Destination objects: Account, CommercientSF13__NETSUITE_ITEM__c, PricebookEntry, Product2, CommercientSF13__NETSUITE_INVOICE__c, CommercientSF13__NETSUITE_CUSTOMERS__c, CommercientSF13__NETSUITE_INVOICEITEM__c, CommercientSF13__NETSUITE_SALESORDER__c, CommercientSF13__NETSUITE_SALESORDERITEM__c, CommercientSF13__NETSUITE_CUSTOMERADDRESSBOOK__c, CommercientSF13__NETSUITE_Warehouse__c, Contact, CommercientSF13__NETSUITE_SalesPerson__c, NETSUITE_RMA_Order_Line__c, CommercientSF13__ACCOUNTMATCHING__c, CommercientSF13__NETSUITE_TERM__c, NETSUITE_RMA_Order__c, Pricebook2, Pricebookentry, CreditMemo__c, 11 more and 2 custom objects
  • Object display names: Account, Customer To Account Reverse Lookup, Account-Child, Contact, Customer Address Book, Invoice, Product, Customer, Invoice Line, Item, Item Warehouse, SalesOrder, 54 more and 3 further templates
  • Template groups: Account, Product, Salesorder, Invoice, Customer Multi Ship Addresses, 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_NETSUITE_User
  • vw_NETSUITE_Account
  • vw_NETSUITE_CustomerToAccountLookup
  • vw_NETSUITE_Contact
  • vw_NETSUITE_Customer
  • vw_NETSUITE_CustomerAddressBook
  • vw_NETSUITE_Item
  • vw_NETSUITE_ProductToItemReverseLookup
  • vw_NETSUITE_ItemWarehouse
  • vw_NETSUITE_Invoice
  • vw_NETSUITE_InvoiceLine
  • vw_NETSUITE_PriceBook2
  • vw_NETSUITE_StandardProductPriceBook
  • vw_NETSUITE_Product
  • vw_NETSUITE_SalesOrder
  • vw_NETSUITE_SalesOrderLine
  • vw_NETSUITE_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 NetSuite → 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.