Configure and map NetSuite subrecords

Comments

7 comments

  • Bhushan Rane Integration Engineer

    Quite helpful article for new partners, as mapping Inventory Details subrecord can be tricky if you haven't done it before. Thanks Stephen Brandt for putting this together.

    0
  • Ian Luck
    Engaged
    Celigo University Level 4: Legendary

    Is there any way to import a transaction, specifically an invoice, where you have serialized and non-serialized items where some require inventory detail and others do not. This is a questions specific to a NetSuite import. 

     

    0
  • Uma Lakshmi Kanth Garimella Lead Engineer
    Celigo University Level 2: Seasoned

    Hey Ian Luck

    The above article should work for every transactions' inventory detail sub record. Integrator IO would automatically ignore the inventory subrecord for a line if it doesn't have matching inventory detail data from the source. The setup should be the same for all of the transaction types.

    Ideally, our users populate inventory detail in the source only for the item line(s) that require an inventory sub record(serialized, bin, lot lines).

    0
  • Greg Griffin
    Engaged
    Awesome Follow-up

    I have the same issue as Ian. I'm getting errors (ticket # 106465) when I attempt to import a transaction with two items where one is lot enabled and the other is not. If I edit the retry data and include either one of the items it will post correctly. It fails when both items are included in the payload.

     

    1
  • A Arora

    Suppose I have selected 'line_items' as a path for inventory details.
    Is this possible to use the parent level field for inventory details sub-record mapping? 

    0
  • Sachin Goud Godishela Software Engineer
    Answer Pro
    Great Answer
    Celigo University Level 4: Legendary

    Hi A Arora

    It is not possible to use the parent level field for inventory details sub-record mapping. However, you can configure a preMap hook to copy the required parent level fields to line_items.

    Example:

    Lets say our source data is like this (where quantity is a parent field):

        {
        "customername": "Sky Games",
          "salesorderid": "34988",
          "quantity": "15",
        "line_items": [
            {
              "itemname": "Arctic Monkeys Coffee Mug",
              "itemid": "6941",
              "upcode": "4721",
              "subsidiary": "Honeycomb Holdings Inc.",
              "location": "Hyderabad",
              "inv_detail": [
                {
                  "binnumber": "69"
                }
              ]
            }
          ]
        }

    We can configure a preMap hook with the following script to copy the parent field to all line_items:


    function preMap (options) {
      return options.data.map((d) => {
      d.line_items.forEach((item) => {
        item.quantity = d.quantity
        })
        return {
          data: d
        }
      })
    }

    So, before the mapping happens, our source data is modified by the hook to this:

      {
        "data": {
          "customername": "Sky games",
          "customerid": "7013",
          "PO #": "4431",
          "salesorderid": "34988",
          "quantity": "15",
        "line_items": [
            {
              "itemname": "Arctic Monkeys Coffee Mug",
              "itemid": "6941",
              "upcode": "4721",
              "subsidiary": "Honeycomb Holdings Inc.",
              "location": "Hyderabad",
              "inv_detail": [
                {
                  "binnumber": "69"
                }
              ],
            "quantity": "15"
            }
          ]
        }
      }

    Now, in the sub-record mappings you should be able to see 'quantity' in the dropdown list.

    0
  • Justin Bodin
    Celigo University Level 4: Legendary
    Great Answer
    Engaged

    Very helpful article, thank you!

    For a work order completion record, should the inventory detail body-level subrecord be available through Integrator? I am not seeing it, but seems like it should be.

    0

Please sign in to leave a comment.