Oracle-NetSuite-Order-to-Cash.md

Oracle-NetSuite-Order-to-Cash.md

Introduction

With the Oracle NetSuite Order-to-Cash app template you can load raw input data from Oracle NetSuite for the Order-to-Cash process, extracted to either Snowflake or SQl Server using CData Sync. The raw input data is transformed through a series of transformations that take place via dbt (data build tool) and produce the required input data used in Process Mining Order-to-Cash process apps. Order-to-Cash is the process from receiving and processing sales orders for goods and services to payment. The Order-to-Cash process starts from the order and completes at payment received from the customer.

Oracle NetSuite configuration

The Oracle NetSuite Order-to-Cash app template requires NetSuite version 2021.2 or higher. NetSuite has two data model configurations: SuiteTalk and SuiteQL. Both SuiteTalk and SuiteQL schemas are used in this app template.

Important: You need a valid Oracle Netsuite license. NetSuite requires a specific role, which is explained below in the system specific settings.

NetSuite and CData Sync Date Matching

In order for filtering on dates to work, the date format in NetSuite and CData Sync must match. Go to NetSuite -> SetUp -> Company -> General Preferences and make note of the date format (MM/DD/YYYY for instance)

In CData Sync, go to the NetSuite Connection, then to the Advanced tab, and make sure that Net Suite Date Format: is set to the same as above (MM/DD/YYYY for instance)

System specific settings

In NetSuite, go to Setup -> Company -> Enable Features and enable the following in the SuiteCloud tab:

  • CLIENT SUITESCRIPT
  • SERVER SUITESCRIPT
  • SUITESCRIPT SERVER PAGES
  • SOAP WEB SERVICES
  • REST WEB SERVICES
  • TOKEN-BASED AUTHENTICATION
  • OAUTH 2.0

A role should be created for connecting to NetSuite to extract the data. This role must have the permissions that are listed in CData's documentation for their NetSuite connector. Use a naming convention for the role that would be memorable, like CData Connector. Create a token for this role to connect it to CData.

Custom Saved Search Creation

One of the tables that the connector requires must be created in NetSuite as a custom saved search. The custom saved search titled transaction item change log utilizes the Line System Notes Fields... in order to bring in line item level changes into the connector. Follow these steps in order to create the necessary saved search in NetSuite:

Go to Lists -> Search -> Saved Searches -> New. Choose Transaction for the Search Type. Under Search Title type in transaction item change log.

  • Go to Criteria -> Standard and fill in the following:
  • Choose Line System Notes Fields... from the dropdown, and choose Line System Notes: Context. Choose none of and -None-.
  • This will set the description parameter to be is not none

Under the Results tab, add the following fields:

Field
Line Unique Key
Transaction Number
Line System Notes: Context
Line System Notes: Date
Line System Notes: Field
Line System Notes: New Value
Line System Notes: Old Value
Line System Notes: Record
Line System Notes: Record ID
Line System Notes: Record Type
Line System Notes: Role
Line System Notes: Set by
Line System Notes: Type
Department
Status
Vendor: Country
Vendor: Company Name
Save & Run

Click Save & Run to save the search and look at the results.

Configuring CData Sync for Oracle Netsuite Order-to-Cash

Below is a description on how to use CData Sync to set up a source connection and load data into a Process Mining Oracle NetSuite Order-to-Cash process app.

In general, you should follow the steps as described in Loading data using CData Sync (Snowflake) or Loading data using CData Sync (SQL Server) to set up data loading using CData Sync. Since specific settings are required when using Oracle NetSuite, pay attention to the steps described below.

As NetSuite has two schema types: SuiteQL and SuiteTalk, it will be required to create two connections, with one for each schema type. Both connections have their own custom queries, which are listed below.

SuiteQL

SuiteQL is the newer schema that NetSuite uses to interact with the source system data.

Setting up the source connection

  • Select NetSuite as the source system to which you want to create a connection from the list and name the connection SuiteQL_Connection.
  • The Account Id can be found in the URL for your NetSuite instance: Account Id.app.netsuite.com.
  • Select SuiteQL from the Schema drop-down list.
  • Select Token from the Auth Scheme options and enter the token credentials from the role created in NetSuite.

Important: Make sure you edit the Pre-job Event.

CData Sync allows the use of environment variables in order to drive specific extraction logic in each query.

VariableDescriptionComment
start_extraction_dateDefines first date for which data will be extracted.Mandatory
end_extraction_dateLast date for which data will be extracted.

Be mindful of choosing a start_extraction_date that encompasses the data that you want to capture, as orders are the starting point of the order to cash process.

In order to setup the environment variables:

StepAction
1Access the job
2Click on the Events tab.
3Edit the Pre-Job Event section to add the code displayed below

<!-- Modify environment variables here. --> <!-- Variable start_extraction_date must be populated.--> <api:set attr="out.env:start_extraction_date" value="01/01/2022" /> <!-- In case a specific end date is needed, replace the value string with the required date in the Date format listed in NetSuite. --> <!-- i.e api:set attr="out.env:end_extraction_date" value="01/01/2022" --> <api:set attr="out.env:end_extraction_date" value= '12/31/3000' /> <api:push item="out" />

Important: Do not modify the api:info details that are shown by default.

In order to modify the environment variables, modify the values within the Events tab. By default, end_extraction_date will default to today's date. start_extraction_date must always be populated.

Table Replication

Once the job is correctly setup, click on Add Custom Query under the Tables tab and paste the following queries (each query needs to maintain the semicolon at the end). Make sure you save all changes.

Use the following custom query for SuiteQL when creating the job:

REPLICATE [employee_raw] WITH TruncateTableData = 'True' SELECT [id], [employeetype], [entityid], [title] FROM [employee]; REPLICATE [entity_raw] WITH TruncateTableData = 'True' SELECT [id], [entityid] FROM [entity]; REPLICATE [item_raw] WITH TruncateTableData = 'True' SELECT [id], [fullname] FROM [item]; REPLICATE [location_raw] WITH TruncateTableData = 'True' SELECT [id], [fullname] FROM [location]; REPLICATE [previoustransactionlinelink_raw] WITH TruncateTableData = 'True' SELECT [linktype], [nextdoc], [nextline], [nexttype], [previousdoc], [previousline] FROM [previoustransactionlinelink] WHERE [nexttype] IN ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale'); REPLICATE [systemnote_raw] WITH TruncateTableData = 'True' SELECT [id], [date], [field], [name], [newvalue], [oldvalue], [record], [recordid], [recordtypeid] FROM [systemnote] WHERE [field] IN ('TRANDOC.KSTATUS', 'TRANLINE.MESTAMOUNT', 'TRANDOC.BPAYMENTHOLD', 'TRANDOC.STRANTYPE', 'TRANLINE.RITEMCOUNT', 'TRANLINE.MAMOUNT', 'TRANDOC.MAMOUNTMAIN', 'TRANLINE.RUNITPRICE', 'TRANDOC.DSHIP', 'CUSTBODY_REPORT_TIMESTAMP', 'TRANDOC.KFORMTEMPLATE') AND ([recordtypeid] = -30) AND ([date] >= '{env:start_extraction_date}') AND ([date] <= '{env:end_extraction_date}'); REPLICATE [term_raw] WITH TruncateTableData = 'True' SELECT [id], [daysuntilexpiry], [daysuntilnetdue], [discountpercent], [name] FROM [term]; REPLICATE [transaction_raw] WITH TruncateTableData = 'True' SELECT [id], [createdby], [createddate], [currency], [duedate], [employee], [exchangerate], [status], [terms], [trandisplayname], [type], [voided] FROM [transaction] WHERE [type] IN ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale') AND ([createddate] >= '{env:start_extraction_date}') AND ([createddate] <= '{env:end_extraction_date}'); REPLICATE [transactionhistory_raw] WITH TruncateTableData = 'True' SELECT [action], [datetime], [entity], [internalid], [type], [username] FROM [transactionhistory] WHERE [type] IN ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale') AND ([datetime] >= '{env:start_extraction_date}') AND ([datetime] <= '{env:end_extraction_date}'); REPLICATE [transactionline_raw] WITH TruncateTableData = 'True' SELECT DISTINCT [uniquekey], TL.[createdfrom], [department], TL.[entity], [inventorylocation], [item], [itemtype], [linesequencenumber], [location], [netamount], [quantity], [subsidiary], [taxline], [transaction], [units] FROM [transactionline] AS TL JOIN [transaction] as T ON TL.[transaction] = t.[id] WHERE [type] IN ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale'); REPLICATE [unitstypeuom_raw] WITH TruncateTableData = 'True' SELECT [internalid], [unitname] FROM [unitstypeuom];

Make sure that the query for transactionline works, as it is a custom case where it is joined to the transaction table in order to filter to only include transaction lines for transactions in the order to cash process.

Following these steps will set up all the requirements for the SuiteQL connection tables. Next, a connection to SuiteTalk will be covered to bring in the required custom saved search.

SuiteTalk

SuiteTalk is the schema required to bring in saved searches, and custom saved searches.

In order for the custom saved search to work, the steps to allow for CData to find RESTlet schemas must be followed first. These directions are listed in the Search_script for RESTlets section below. The custom saved search, transaction_item_change_log must also be created first in the NetSuite instance in order for it to be found and connected with CData.

Setting up the source connection

  • Select NetSuite as the source system to which you want to create a connection from the list and name the connection SuiteTalk_Connection.
  • The Account Id can be found in the URL for your NetSuite instance: Account Id.app.NetSuite.com.
  • Select SuiteTalk from the Schema drop-down list.
  • Select Token from the Auth Scheme options and enter the token credentials from the role created in NetSuite.
  • On the Custom Schemas tab, add a new CreateRestletSchema schema.
  • Enter transaction_item_change_log_raw for the TableName.
  • Enter the SearchId, ScriptId, and DeploymentNum and click Create.

Search_script for RESTlets

A JavaScript file, called search_script.js, must be added to NetSuite in order for RESTlet Saved Search Queries to work. Follow the steps from the CData documentation to set this up. This will allow for the Custom Saved Search transaction_item_change_log to be used.

Important: Make sure you edit the Pre-job Event. CData allows the use of environment variables in order to drive specific extraction logic in each query.

VariableDescriptionComment
start_extraction_dateDefines first date for which data will be extracted.Mandatory
end_extraction_dateLast date for which data will be extracted.

Be mindful of choosing a start_extraction_date that encompasses the data that you want to capture, as orders are the starting point of the order to cash process.

In order to setup the environment variables:

StepAction
1Access the job created in the previous step.
2Click on the Events tab.
3Add the following lines to the Pre-Job Event script.

<!-- Modify environment variables here. --> <!-- Variable start_extraction_date must be populated.--> <api:set attr="out.env:start_extraction_date" value="01/01/2022" /> <!-- In case a specific end date is needed, replace the value string with the required date in the Date format listed in NetSuite. --> <!-- i.e api:set attr="out.env:end_extraction_date" value="01/01/2022" --> <api:set attr="out.env:end_extraction_date" value= '12/31/3000' /> <api:push item="out" />

Important: Do not modify the api:info details that are shown by default.

In order to modify the environment variables, modify the values within the Events tab. By default, end_extraction_date will default to today's date. start_extraction_date must always be populated.

Table Replication

Once the job is correctly setup, click on Add Custom Query under the Tables tab and paste the following query. Make sure you save all changes. Use the following custom query for SuiteTalk when creating the job:

REPLICATE [transaction_item_change_log_raw] WITH TruncateTableData = 'True' SELECT [Line_Unique_Key], [Transaction_Number], [Context], [Date], [Field_text] as [Field], [New_Value], [Old_Value], [Record], [Record_ID], [Record_Type], [Role_text] as [Role], [Set_by_text] as [Set_by], [Type], [Department_text] as [Department], [Status_text] as [Status], [Internal_ID_text] as [Internal_ID] FROM [transaction_item_change_log] WHERE ([Date] >= '{env:start_extraction_date}') AND ([Date] <= '{env:end_extraction_date}'); REPLICATE [SalesOrder_raw] WITH TruncateTableData = 'True' SELECT [InternalId], [BillingAddress_Country], [BillingAddress_State], [Department_Name], [Entity_Name], [SalesGroup_Name], [ShippingAddress_Country],[Subsidiary_Name] FROM [SalesOrder];

Input fields

This section contains an overview of the fields for each of the input tables of the Oracle NetSuite Order-to-Cash app template. For each table the fields are listed. Below is a list of tables that are brought in with the NetSuite SuiteQL Schema specified:

  • employee
  • entity
  • item
  • location
  • systemnote
  • term
  • transaction
  • transactionhistory
  • transactionline
  • unitstypeuom
  • previoustransactionlinelink

The following is a list of tables that are brought in with the NetSuite SuiteTalk Schema specified:

  • SalesOrder
  • transaction_item_change_log

The transaction_item_change_log is a custom saved search that has been created for the purpose of bringing line item change history into the transformations.

More information can be found on these tables in the NetSuite help center. The Analytics Browser tab is for SuiteQL tables.

employee

FieldData typeLabelFiltering
idTextInternal ID
employeetypeTextType
entityidTextEntity ID
titleTextJob Title

entity

FieldData typeLabelFiltering
idTextInternal ID
entityidTextEntity name

item

FieldData typeLabelFiltering
idTextInternal ID
fullnameTextInternal ID

location

FieldData typeLabelFiltering
idTextInternal ID
fullnameTextFull Name
FieldData typeLabelFiltering
linktypeTextLink Type
nextdocTextTransaction ID of next document
nextlineTextLine ID of the next document line
nexttypeTextNext document typein ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale')
previousdocTextTransaction ID of previous document
previouslineTextLine ID of the previous document line

systemnote

FieldData typeLabelFiltering
idTextInternal ID
datedateDate
fieldTextField where systemnote change occursin ('TRANDOC.KSTATUS', 'TRANLINE.MESTAMOUNT', 'TRANDOC.BPAYMENTHOLD', 'TRANDOC.STRANTYPE', 'TRANLINE.RITEMCOUNT', 'TRANLINE.MAMOUNT', 'TRANDOC.MAMOUNTMAIN', 'TRANLINE.RUNITPRICE', 'TRANDOC.DSHIP', 'CUSTBODY_REPORT_TIMESTAMP')
nameTextOwner internal id
newvalueTextNew value
oldvalueTextOld value
recordTextRecord name
recordidTextTransaction id
recordtypeidTextState-30

term

FieldData typeLabelFiltering
idTextInternal ID
daysuntilexpiryIntegerDays Till Discount Expires
daysuntilnetdueIntegerDays Till Net Due
discountpercentDouble% Discount
nameTextTerms

transaction

FieldData typeLabelFiltering
idTextInternal ID
createdbyTextCreated By
createddateTextDate Created
currencyTextCurrency
duedateTextDue Date
employeeTextSales Rep
exchangerateTextExchange Rate
statusTextStatus
termsTextTerms
trandisplaynameTextTransaction Name
typeTextTypein ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale')
voidedBooleanVoided

transactionhistory

FieldData typeLabelFiltering
internalidTextTransaction ID
actionTextAction
datetimeDatetimeDatetime
entityTextEntity
typeTextTypein ('SalesOrd', 'CustPymt', 'ItemShip', 'Deposit', 'CustInvc', 'RtnAuth', 'CashSale')
usernameTextUser

transactionline

This table is joined to the transaction table in order to filter on transaction."type"

FieldData typeLabelFiltering
uniquekeyTextUnique Key
createdfromTextCreated From
departmentTextDepartment
entityTextEntity
inventorylocationTextStorage location
itemTextItem
itemtypeTextItem Type
linesequencenumberTextLine Number
locationTextLocation
netamountDoubleAmount (Net) (Transaction Currency)
quantityDoubleQuantity
subsidiaryTextSubsidiary
taxlineTextTax Line
transactionTextTransaction ID
unitsTextUnit ID

unitstypeuom

FieldData typeLabelFiltering
internalidTextInternal ID
unitnameTextName of the measuring unit

SalesOrder

FieldData typeLabelFiltering
InternalIdTextUnique ID of the sales order
BillingAddress_CountryTextBilling country of the customer
BillingAddress_StateTextBilling state/region of the customer
Department_NameTextThe display name of the department
Entity_NameTextThe display name of the customer
SalesGroup_NameTextThe display name of the sales group
ShippingAddress_CountryTextShipping country of the sales order
Subsidiary_NameTextThe display name of the subsidiary

transaction_item_change_log

This is the table created as a custom saved search and connected through the SuiteTalk RESTlet Saved Search Schema.

FieldData typeLabelFiltering
Line_Unique_KeyTextUnique ID of the line item
Transaction_NumberTextTransaction document number
ContextTextExecution context of the change
DateDatetimeDatetime
FieldTextField of change
New_ValueTextNew value
Old_ValueTextOld value
RecordTextRecord type
Record_IDTextTransaction ID
Record_TypeTextOne word record type
RoleTextName of the role making the change
Set_byTextName of user making the change
Internal_IDTextUser ID of person making the change
StatusTextStatus of the transaction
TypeTextChange log action type
DepartmentTextName of the department

Design specifications

Entities

Below is an overview of the entities, and their attributes, of the Oracle NetSuite Order-to-Cash app template.

Sales_orders_base

NameAttributeData typeMandatory Y/NDescription
Sales order IDSalesOrder."InternalId"TextYThe unique identifier of the sales order.
CompanySalesOrder."Subsidiary_Name"TextNThe company for which the sales order is created.
CustomerSalesOrder."Entity_Name"TextNThe customer for whom the sales order is created.
Customer countrySalesOrder."BillingAddress_Country"TextNThe country associated to the customer.
Customer regionSalesOrder."BillingAddress_State"TextNThe region associated to the customer.
Distribution channelattributeTextNThe distribution channel associated to the sales order.
DivisionSalesOrder."Department_Name"TextNThe division associated to the sales order.
Requested delivery dateattributeDateNThe customer’s requested delivery date for the sales order.
Sales groupSalesOrder."SalesGroup_Name"TextNThe sales group associated to the sales order.
Sales officeattributeTextNThe sales office associated to the sales order.
Sales order typeattributeTextNThe sales order type of the sales order.
Sales organizationattributeTextNThe sales organization of the sales order.

Sales_order_items_base

NameAttributeData typeMandatory Y/NDescription
Sales order item IDtransactionline."uniquekey"TextYThe unique identifier of the sales order item.
Sales order IDtransactionline."transaction"TextYThe unique identifier of the sales order.
Creation datetransaction."createddateDateYThe date on which the sales order item is created.
Categorytransactionline."itemtype"TextNThe category of sales order item.
IncotermsattributeTextNThe incoterms associated to the sales order item.
Latest expected delivery datetransaction."duedate"DateNThe latest expected delivery date of (parts of) the sales order item.
Materialitems."fullname"TextNThe material sold.
Material grouptransactionline."itemtype"TextNThe categorization of the material sold.
Payment termsterm."name"TextNThe terms of payment associated to the sales order item.
Plantlocation."fullname"TextNThe plant associated to the sales order item.
Profit centerattributeTextNThe profit center associated to the sales order item.
Quantityconcat(abs(transactionlines."Quantity"), ' ', ifnull(unitstypeuom."Unit_name", 'Units'))TextNThe quantity and unit of measurement sold.
Sales order itemconcat(transactions."trandisplayname", '-', transactionlines."lineid")TextNA user-friendly name to identify the sales order item
Shipping point countrySalesOrder."ShippingAddress_Country"TextNThe country where the goods are delivered associated to the sales order item.
Storage locationtransactionlines."Inventory_location"TextNStorage location associated to the sales order item.
Valueabs(transactionline."netamount" * transaction."exchangerate")DoubleNA monetary value related to the sales order item.

Deliveries_base

NameAttributeData typeMandatory Y/NDescription
Delivery IDtransaction."id"TextYThe unique identifier of the delivery.

Delivery_items_base

NameAttributeData typeMandatory Y/NDescription
Delivery item IDtransactionline."uniquekey"TextYThe unique identifier of the delivery item.
Delivery IDtransactionline."transaction"TextN*The unique identifier of the delivery.
Sales order items IDtransactionline."uniquekey"TextN*The unique identifier of the sales order item.
Delivery items is invoicedattributeBooleanNIndicates if the sales order item is released to invoicing.

Invoices_base

NameAttributeData typeMandatory Y/NDescription
Invoice IDtransaction."id"TextYThe unique identifier of the invoice.

Invoice_items_base

NameAttributeData typeMandatory Y/NDescription
Invoice item IDtransactionline."uniquekey"TextYThe unique identifier of the invoice item.
Invoice IDtransactionline."transaction"TextN*The unique identifier of the invoice.
Delivery item IDtransactionline."uniquekey"TextN*The unique identifier of the delivery item.
Invoice item is cancelledtransaction."voided"BooleanNIndicates if the invoice item is cancelled.
Invoice item is released into accountingattributeBooleanNIndicates if the invoice item is billable.

Invoice_cancellations_base

NameAttributeData typeMandatory Y/NDescription
Invoice cancellation IDtransaction."id"TextYThe unique identifier of the invoice cancellation.
Invoice IDtransaction."id"TextN*The unique identifier of the invoice that is cancelled.

Accounting_documents_base

NameAttributeData typeMandatory Y/NDescription
Accounting document IDconcat(transactionline."transaction", transactionline."createdfrom")TextYThe unique identifier of the accounting document.
Invoice IDtransactionline."createdfrom"TextN*The unique identifier of the invoice.
Accounting document is clearedattributeBooleanNIndicates if the accounting document has been handled and is closed.

Payments_base

NameAttributeData typeMandatory Y/NDescription
Payment IDtransaction."id"TextYThe unique identifier of the payment.
Accounting document IDconcat(transactionline."transaction", transactionline."createdfrom")TextN*The unique identifier of the accounting document.

Activities

Create sales order

This identifies the creation action of a sales order.

transactionhistory."action" = 'CREATE' WHERE transactionhistory."context" = 'SalesOrd'

Delete sales order

This identifies the deletion action of a sales order.

transactionhistory."action" = 'DELETE' WHERE transactionhistory."context" = 'SalesOrd'

Create sales order item

This identifies the creation action of a sales order item.

Change sales order item price

This identifies a change to the price of a sales order item.

transaction_item_change_log."Field" = 'Amount'

Change sales order item quantity

This identifies a change to the quantity of a sales order item.

transaction_item_change_log."Field" = 'Quantity'

Change sales order item location

This identifies a change to the location of a sales order item.

transaction_item_change_log."Field" = 'Location'

Close sales order item

This identifies that a sales order item has been closed or voided.

transaction_item_change_log."Field" = 'Closed'

Create customer delivery

This identifies the creation action of a delivery.

transactionhistory."action" = 'CREATE' WHERE transactionhistory."context" = 'ItemShip'

Delete customer delivery

This identifies the deletion action of a delivery.

transactionhistory."action" = 'DELETE' WHERE transactionhistory."context" = 'ItemShip'

Goods picked

This identifies that the goods for this delivery have been picked.

systemnote."field" = 'TRANDOC.KSTATUS' and systemnote."newvalue" = 'Picked'

Goods packed

This identifies that the goods for this delivery have been packed.

systemnote."field" = 'TRANDOC.KSTATUS' and systemnote."newvalue" = 'Packed'

Goods shipped

This identifies that the goods for this delivery have been shipped.

systemnote."field" = 'TRANDOC.KSTATUS' and systemnote."newvalue" = 'Shipped'

Create delivery item

This identifies the creation action of a delivery item.

Change delivery item price

This identifies a change to the delivery item price.

transaction_item_change_log."Field" = 'Amount'

Change delivery item quantity

This identifies a change to the delivery item quantity.

transaction_item_change_log."Field" = 'Quantity'

Change delivery item location

This identifies a change to the delivery item location.

transaction_item_change_log."Field" = 'Location'

Create customer invoice

This identifies the creation action of a customer invoice.

transactionhistory."action" = 'CREATE' WHERE transactionhistory."context" = 'CustInvc'

Delete customer invoice

This identifies the deletion action of a customer invoice.

transactionhistory."action" = 'DELETE' WHERE transactionhistory."context" = 'CustInvc'

Create invoice item

This identifies the creation action of an invoice item.

Change invoice item price

This identifies a change to the price of an invoice item.

transaction_item_change_log."Field" = 'Amount'

Change invoice item quantity

This identifies a change to the quantity of an invoice item.

transaction_item_change_log."Field" = 'Quantity'

Cancel invoice

This identifies the cancellation of an invoice.

systemnote."Field" = 'TRANDOC.KSTATUS' and systemnote."New_value" = 'Voided'

Item returned

This identifies an item return.

transaction_item_change_log."Field" = 'Closed' where transaction_item_change_log."Record_type" = 'returnauthorization'

Receive payment

This identifies payment receipt.

systemnote."field" = 'TRANDOC.KSTATUS' and systemnote."newvalue" = 'Paid In Full'

Events_base

The model Events_base, located in the 3_events directory, is a union of all the outputs from the other models in the 3_events directory. Each event is unique and corresponds to one ID (i.e. Sales order ID, Sales order item ID, etc.).

Customizing the transformations

Configuration

Automated Users

A variable exists in dbt_project.yml called Automated_users for users to specify the automated users that exist in the Entity table. Please add the entity.id for these users to this variable.

Limitations, known issues, common problems

Limitations

NetSuite SuiteQL relies on some incredibly large tables for its data, which can be filtered by specifying the record types required. Not filtering on these can cause a lot of performance issues with either Snowflake or SQL Server, and will replicate a lot of superfluous data.

If you plan on using CSV files and are going to be using the SQL Query Editor for exporting the SuiteQL tables, the SQL Query Editor tool only allows for up to 5,000 rows to be exported in each query. If more rows are needed, one can filter based on date, and add the results together into a larger file.

Filtering the transactionline table is important, as it can be a rather large table if one does not. However, this requires joining the transactionline and transaction tables in order to filter transactionline to only include the transaction types that are listed in the filtering above. Please use the custom query located in load-from-source for transactionline in order to filter correctly.

DELETE activities like Delete sales order or Delete invoice will only appear in the process graph if the case has been deleted after the initial data has been pulled. Deleted orders and invoices will appear in the transactionhistory table, but will be removed from the transaction, transactionline, systemnote, and transaction_item_change_log tables.

Void activities are built with NetSuite having Void transactions using reversing disabled. In NetSuite, go to Setup -> Accounting -> Accounting Preferences to check.

The line link between delivery items and invoice items is implied, since they link back to the same sales order item line. Staging models Delivery_invoice_relation and Invoice_sales_relation create a rownum to match the delivery item and invoice item, as a sales order item may have multiple deliveries and multiple invoices. This assumes that the first delivery corresponds to the first invoice and so on. If the second delivery is invoiced first, then the relation will be incorrect. We expect this issue to be highly unlikely to occur, but wanted to make users aware of the potentiality.

Known issues

NetSuite is structurally built around the header level, so tracking item level changes requires utilizing a mixture of SuiteTalk and SuiteQL Schemas to find and pull the requisite data for process mining.

If you encounter errors when running a job that state column not found, go to the Advanced tab of the NetSuite Connection and set the Row Scan Depth: to 0

Common problems

CData Sync may exhibit some issues in filtering the extraction tables on multiple values, so this is something to keep in mind if you do encounter similar issues. Some of the input fields of the entities are blank as they are not in the NetSuite system. Sales order type is an example.

ncG1vNJzZmicn5jCrrHNrZitoZ%2Bjvaqv066pnqqVpbxvrsuomWebn6eyb8PIp5uor6Nju6bAjp%2BgpZ2jZJ2zu8KeqqyXfZ67qrrGaGlpamJjfnF7rquYnKSVYpumwLKuoK2dXYS%2FpbHRZquoZXOWwKl7rquYnKSVYpumwLKuoK2dXYS%2FpbHRZquoZXOWwKl6x62kpQ%3D%3D