Custom Objects

13min

Background

This article applies to NetSuite custom objects, which are not a part of the standard set of objects or tables available in NetSuite by default. These custom objects in NetSuite are generally created by an admin/dev or by the addition of third-party tools. Breadwinner for NetSuite is a managed package but can be configured to incorporate custom and non-standard object data syncing to and from NetSuite. 

You can see a list of available NetSuite custom objects in the ‘Custom’ category under the NetSuite Objects section of the Breadwinner for NetSuite tab.

Document image


 

Breadwinner can sync NetSuite custom objects with Salesforce and can keep them updated over time. 

Creating Objects using Breadwinner

To create a custom object using Breadwinner, go to the Breadwinner for NetSuite Tab -> NetSuite Objects page, shown above. Breadwinner will create the custom Salesforce object based on the custom NetSuite object selected by clicking the 'Create in Salesforce' button. If the current object is the child of another object, you can optionally select its Parent object and the field that identifies the Parent ID.

Parent Lookup Field Selection

For the selection of Parent Objects, we display the Breadwinner objects and already created NetSuite custom objects with the "nco_" prefix in their API Name.

Once you click on the “Yes” button, it will create two fields for lookup identification. Breadwinner will create the Lookup field between the newly created child object and the selected Parent object. Breadwinner will also create the text field on the Child object to store that parent record's Internal Id.

Note: Currently, Breadwinner allows one Lookup field creation from the Configuration. If you have multiple Parent fields, we suggest manually creating them.

Selecting the Parent object and Parent ID field is optional.

For Lookup fields, the API Name will start with the prefix “ncl_” and for the Internal ID field, the API Name will have the prefix as “nid_”.

Example:

Document image


In the above screenshot, I have selected the "NetSuite Company" as Parent object and "Customer" field to identify the Parent record on child object (nco_apm_db_setup_general). Lookup field: Parent lookup field created with the Label: Customer and the API Name: ncl_record_customer__c

Internal Id field: Parent Internal ID field created with the Label: Customer Internal ID and the API Name: nid_record_customer__c

Document image


On clicking Yes, in the popup displayed, Breadwinner will create a new Salesforce custom object by using the schema of the NetSuite custom object. The new Salesforce custom object label will be the same as the NetSuite custom object label. However, the custom object API name will be slightly different. The custom object API name in NetSuite always starts with the prefix “customrecord_”, but Breadwinner replaces that with the prefix “nco_” (NetSuite Custom Object). 

Due to Salesforce limitations and to respect your organization's security, Breadwinner will not create a tab for the new custom object. Furthermore, the object and its fields are hidden from all users until you expose them by applying standard Salesforce security, such as using Profiles, Permission Sets, and Field Level Security.

Providing Object Permissions

Breadwinner can’t populate the data in the new custom object created unless the user who set up Breadwinner and scheduled the syncs (aka running user) has the necessary permissions on the object and its fields. 

So, in order to provide permissions, you can either use Salesforce Profile level permissions or create a Permission Set and assign it to desired users who need access to the object. Optionally, you can create a custom tab for the new custom object.

For example, below is shown a permission set called “NetSuite Custom Object Permissions” and given custom object and field permissions in the following screenshot.

Document image


Enable / Disable Sync

After creating an object, you can navigate to the Custom category of the NetSuite Objects section in the Breadwinner for NetSuite tab. Here, you can enable the sync by clicking on the Sync Status toggle, and then clicking on Save. If you wish to stop syncing the custom object records into Salesforce, you can simply disable the Sync Status toggle, and click on Save to confirm the changes.

Document image


Start Syncing the Object Records

After following all the steps above, you can start fetching the NetSuite custom object records into Salesforce by clicking the "Restart NetSuite Custom Object Sync" button available from the Troubleshooting section of the Breadwinner for NetSuite tab. Please note that depending on the size of your data, the syncing process may take a few minutes, hours, or even days.

Document image


Creating Objects manually

The second method is to create custom Salesforce objects yourself and point Breadwinner to those objects by enabling the sync below. 

If you choose this method, you must use specific API naming standards defined by Breadwinner in order for data to sync successfully.

  • The custom object you create must have an API name prefixed with “nco_” (NetSuite Custom Object). Although the custom object API name in NetSuite always starts with the prefix “customrecord_”, but Breadwinner considers an object when the prefix is “nco_”.
  • The custom object must contain the field “InternalId__c” text field, to store the NetSuite object record id.
  • The custom object must contain the field “NetSuite_Org_Id__c” text field, to store the connected NetSuite Org Id.
  • Avoid inadvertently creating or renaming objects in Salesforce whose API name starts with "nco_." This being the key for Breadwinner to find and integrate the table may cause unwanted side effects.

Manual Lookup field creation

While creating the custom object from the configuration section, Breadwinner allows only one Parent Lookup field creation on the child object. If you want to create more than one Parent field, you can follow the below steps to create the Lookup field on the child object.

Step 1:

  1. Create the Lookup field from the child object by selecting the desired Parent object. 
  • The field label can be anything, though we recommend using the same field label as in NetSuite. 
  • Field Name must start with ncl_. The prefix ncl_ will replace cust in the NetSuite API Name.
  • Ex: If the custom field name is “custrecord_customer” then give the field name as “ncl_record_customer__c”.

Screenshot of the Lookup field:

Document image


Step 2:

  1. After the Lookup field creation, create the Text field with the prefix “nid_” to store the parent record internal ID.
  • The field label can be anything, though we recommend using the same field label as in NetSuite and add the suffix “Internal Id”. 
  • Field Name must start with nid_. The prefix nid_ will replace cust in the NetSuite API Name.
  • Ex: If the custom field name is “custrecord_customer” then give the field name as “nid_record_customer__c”.

Screenshot of the Internal Id field:

Document image


Step 3:

Assign the field-level permissions for the above two fields on the child object.

Step 4:

After creating the Lookup and Text field, please restart the Custom Object sync by clicking the "Restart Custom Object Sync" button from the Troubleshoot -> General section.