In general, NetSuite supports creating a parent-child relationship between items using NetSuite's native Matrix Item functionality. This feature allows you to leverage the virtual variation functionality by Celigo to setup a parent-child relationship between the Inventory (Matrix & Non-Matrix), Assembly (Matrix & Non-Matrix), and Kit Items without using the matrix item feature in NetSuite.
Using this feature, items set up as Virtual variation items in NetSuite can be exported as regular Matrix Items in Magento 2. To support this feature, the NetSuite Item to Magento Product Add/Update and NetSuite Matrix Item to Magento Configurable Product Add/Update flow has been enhanced to accommodate the creation of virtual variation items. The Integration App allows you to use the SUBITEM OF field or a custom field on the item record where you specify the parent of an item for creating the parent-child relationship needed for item records in NetSuite. Note that if you decide to use a custom field for this purpose, the custom field must be a drop-down field similar to the SUBITEM OF field and cannot be a text field.
Prerequisites to leverage the Virtual Variation Functionality
Configurations needed in NetSuiteYou need to make the following changes in NetSuite to use this feature:
- Enable the IS VIRTUAL VARIATION checkbox for the desired item record in NetSuite.
You need to enable the IS VIRTUAL VARIATION checkbox in the eTail tab of item record for all the items for which you want to establish the parent-child relationship in NetSuite using the virtual variation functionality. This should be done for both the parent as well as the corresponding child items. In addition to this, the “Subitem Of” field on the child item record should be populated with the parent item record.
- Create Custom field with Variations attribute.
Similar to matrix option custom fields, you are required to map variations created in the item record with the Product > Attributes created in Magento.
In the following image size and color are the two variation custom fields created within the item record:
- Edit the Celigo Magento 2 Item Export Search saved search
In this saved search, under the Results tab select the custom field created in NetSuite for storing the variation theme information and add a custom label to it. For example:
- Edit the Celigo Magento 2 Matrix Item Export Search saved search
In this saved search, under the Results tab select the custom field created in NetSuite for storing the variation theme information and add a custom label to it.
Note: It is mandatory to add “(Virtual Variation Option)” as a suffix to every custom label.
- Configure Field Mappings
For the NetSuite Item to Magento Product Add/Update and NetSuite Matrix Item to Magento Configurable Product Add/Update flow, configure the Field Mapping. Select the Custom field from NetSuite with the variation theme information in the Export Field (NetSuite) column and define the Magento 2 attribute name against it. Ensure that the attribute name you add in the Import Field (REST API) column is in the following format:
Configure the Advanced SettingsIn the Product section, go to Advanced Settings and select a value in the NetSuite Saved Search for syncing Item details and NetSuite Saved Search for syncing Matrix Item details drop-down list. Now, select the Enable virtual variations checkbox which in turn displays the NetSuite field identifier for variation parent item field. Enter the Field Id value of the NetSuite field where you specify the parent of an item.
Note: By default, the value parent is displayed in the NetSuite field identifier for variation parent item field as a parent is the Field Id value of the SUBITEM OF field in NetSuite. You can change it to the Field Id value of the NetSuite field where you specify the parent of a virtual variation item.
- Modify Script to Support Information Sync when a Child Item is edited in NetSuite
The saved searches in NetSuite only validates the changes directly made into the parent item record. To ensure that the Integration App also syncs any changes made into child item from NetSuite into Magento 2 you need to use the following steps:
- Login to your NetSuite account.
- Go to Customization > Scripting > Scripts. The scripts page is displayed.
- Search for the Celigo Magento 2 Item Map UE User Event with Bundle ID as 114244 and click Deployments. The Script Deployment page is displayed.
- Click Edit against RECORD TYPE.
- Click Parameters sub-tab and enter the same value as mentioned in the NetSuite field identifier for variation parent item field in Advanced Settings of the Integration App.
- Click Save.
- Repeat steps 4, 5, 6 for all records types you wish to use for creating virtual variations.