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 ensure that reports are enabled for this object create a report, selecting the report type "netsuite objects" 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 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 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 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 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 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