Advanced Topics

Sync Data Filtering

12min

Breadwinner automatically syncs all historical data from NetSuite to Salesforce during the historical sync. However, if you wish to exclude certain data from the sync, you can use the data filtering option. If filters are applied, Breadwinner will only sync data based on your chosen criteria.

Sync data can be filtered using two primary methods.

  • Date Filtering
  • Custom Field Filtering
  • Additional Object-specific filtering

Date Filtering

Date Filtering is where Data on the standard sync process is filtered by the "DateCreated" value.

Example: dateCreated>1664582400 This will filter any records before 10/1/2022 with this statement. It's just the value; no single (') or double (") quotes are needed.

In the example above, 1664582400 is an EPOCH timestamp, which translates into October 1, 2022. Use this link to format your NetSuite datetime into an EPOCH date.



Custom Field Filtering

Custom Field Filtering is where Data on the standard sync process is filtered by using a custom field. This is the most flexible means of filtering, but it requires some work on the NetSuite side. This works by telling us what type of field it is and what the api name field in NetSuite is. You must prefix the name of the NetSuite API field name with 'cf_' + the data type + NetSuite API Name equal sign + the value.

Example: cf_boolean_custentity_sync_with_salesforce=true

Here, "Sync to Salesforce" is a custom checkbox field in NetSuite that is applied to the NetSuite Customer (Entity). We will only bring in those customers where the custentity_sync_with_salesforce field in NetSuite is 'true'

Breadwinner supports the following data type filters:

Breadwinner Data Type

NetSuite Data Type

Example

date

Date, DateTime

cf_date_custentity_cutoffdate>1606803100

string

Free Form Text

cf_string_custentity_cat=marketing

boolean

Checkbox

cf_boolean_custentity_checkbox=true

long

Integer Number

cf_long_custentity_int=23525234353535

double

Currency, Decimal Number

cf_double_custentity_dbl=235252.343535

select

List/Record

Multiple Select

cf_select_custentity_picklist=1

cf_select_custentity_multi_select=1,2,3

Note: There are no single or double quotes around any of the values.

NetSuite does NOT support filtering on formula fields. These must be a custom field only.

If more than one criteria are needed, you can use +and+ to build more complex filters. The following shows how to indicate only records between 2 dates are to be retrieved: cf_date_custentity13>1606803100+and+cf_date_custentity13<1606805200

Additional Object-Specific filtering

Each object has a specific list of standard fields that are supported. Search for Supported “where” Filters in the respective Global API—Read section of this document for the object in question.

Warning

Do Not Filter key objects

Some objects are key to the Breadwinner's internal processes. So, do not apply any filters to the following objects:

Classification Currency Department Employee Location PriceLevel Subsidiary

Considerations when filtering on Customers/Vendors

Additional work is required if you are filtering on Customers or Vendors. Because Customer/Vendor records have child records under them (Sales Orders, invoices, Estimates, Purchase Orders, etc.), you will also need to add filters to these objects.



How To Guide

Please keep in mind that editing these fields requires some effort by design. This is because these powerful filters can be tricky to get right, and thus, they are not exposed by default.

One way to access these fields is to create a Tab for the NetSuite Object object, and then use standard List Views to edit that field for each object/subsidiary combination. Views allow Mass Editing.

Another way, shown below, involves using Reports with Field Editing.

Accessing the "Additional Where Filter" field via a Report

Find the object using the Object Manager

Document image


Ensure that Reports are enabled for this object.

Document image


Create a Report, selecting the Report Type "NetSuite Objects"

Document image


Ensure your report is filtered for "All NetSuite Objects" (not "My NetSuite Objects") and Subsidiary equals to connected NetSuite Org Id and show whatever fields you think necessary. We recommend the Subsidiary and the Additional Where Filter as columns.

Document image


For each record you want to set a filter for, click that line in the report to access the record representing that Subsidiary / Object combination. (Enable Field Editing on the report will not help you as the underlying field is a Long Text Field, which cannot be edited through a report).

The additional_where_filter is set at the object level, not at the subsidiary level for each object.



Document image


Once you have updated the additional_where_fitler, you can click the 'Update Record Count' button on the NetSuite Object Sync Configuration page (Go to Setup -> Modify NetSuite Object Sync Settings). This will update the Total Record Count field for the record you just updated.

Document image


Data Hygiene after modifying any "Additional Where Filter" fields

After you have set a filter, there are some data hygiene tasks.

If you have added or changed a filter, there may be some records in Salesforce that need to be manually deleted. There are two ways to do this.

  1. Delete all the records using the Troubleshoot -> General - Delete NetSuite Data in Salesforce option. This will work if you have a small data set. Salesforce limits us to deleting 10K records at a time, so if this is under 50K, this may be your best option. You'll have to click the delete button multiple times. Then run the historical sync (as per below) for that object.

    Document image
    
  2. Run the historical sync (as per below) and then delete records with a Last-Modified date that is before the date/time you started the historical sync.

Keep in mind that a historical sync might take up to 24 hours, or even multiple days, in the case of massive NetSuite records.



Document image