Skip to main content

[Configurable Products] Custom fields and script setup for NS Connector

In order to make Rocket Web connector work with Matrix in NetSuite and map it to the Configurable Products in Magento, some additional settings of the NS project should be done.

They should be done before initial product import to Magento using RocketWeb Connector

  1. Create an additional custom field - Magento Matrix Children
    1. navigate to Customization→Lists, Records, & Fields→Item Fields→New
    2. add information for the custom Item field:
      1. Label - Magento Matrix Children;
      2. ID - _magento_matrix_children
      3. Owner - you;
      4. Description - "Automatically populated with the ids of the matrix children by suite scripting,do not change manually. Need by the Magento  Connector.";
      5. Type - Free-Form Text;
      6. Check "Show in List" and "Global Search" checkboxes;
      7. Tab "Applies To" - check "Inventory Item, Non-Inventory-Item,Kit/Package";
      8. Tab "Display" - choose the position for the field (Subtab, Insert Before) and add help message - "Automatically populated with the ids of the matrix children by suite scripting, do NOT change manually. Need by the Magento  Connector."
      9. as a result you should have next form -
         AAwimage2019-9-30-12-41-25.png
      10. save it.
  2. Create an additional custom field - Magento Matrix Attrs
    1. navigate to Customization→Lists, Records, & Fields→Item Fields→New
    2. add information for the custom Item field:
      1. Label - Magento Matrix Attrs;
      2. ID - _magento_matrix_attrs
      3. Owner - you;
      4. Description - "This field will be populated with the active matrix field names by suitescript, do NOT change manually. by the Magento  Connector.";
      5. Type - Free-Form Text;
      6. Check "Show in List" and "Global Search" checkboxes;
      7. Tab "Applies To" - check "Inventory Item, Non-Inventory-Item,Kit/Package";
      8. Tab "Display" - choose the position for the field (Subtab, Insert Before) and add help message - "Automatically populated with the ids of the matrix children by suite scripting,do not change manually. Need by the Magento  Connector."
      9. as a result you should have next form -
        1cximage2019-9-30-12-47-6.png
      10. save it.
  3. Check any of Items for the added fields:
     EVHimage2019-9-30-12-49-49.png
  4. Add custom script to the NS
    1. navigate to Customization->Scripting->Scripts→New
    2. at the next step upload Rocket Web Custom script -
      SaveDataForMagento2.js
    3. press "Create Script Record"
    4. at the following step - choose script type as "User Event"
    5. fill in the next form :
      1. name - "Save data for Magento";
      2. ID - _save_data_for_magento;
      3. Description - "User event script which populates: custitem_magento_matrix_children custitem_magento_matrix_attrs"
      4. Tab "Scripts", Script File - should be chosen script from 4b step
      5. Tab "Scripts" Before Submit Function - "userEventBeforeSubmit"
      6. Tab "Deployments" - add line with next information
        1. Applies To - "- All Records -"
        2.  Status - "Released"
      7. AS result you should have next form :
        XULimage2019-9-30-13-6-26.png
      8. save it
  5. Check the setting doing next :
    1. find existed Matrix Item
    2. edit and save without changes
    3. our custom fields should be populated with additional data
  6. Now you can set up Rocket Web NC at Magento side.