Hi has anyone done a custom flow on Celigo to crea...
# integrations
k
Hi has anyone done a custom flow on Celigo to create item fulfillment record which includes inventory details, and the serial lots must be automatically (not hard coded) pulled from netsuite. My export Data
Copy code
{
  "exportId": 101010101,
  "order_number": "10",
  "line_items": [
    {
      "sku": "Sku1",
      "quantity": 1
    },
    {
      "sku": "Sku2",
      "quantity": 1
    }
  ],
  "shippingInfo": {
    "tracking_number": "101010101",
    "carrier": "shippo__usps",
    "tracking_url": "<https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=101010101>",
    "created_date": "2023-04-19T22:23:25"
  }
}
a
they don't tell you which serial was shipped?
i have a flow that creates IFs with serial numbers, but they are provided by the vendor
k
Our 3pl has different serial
a
gotcha
however, if you injected a prior flow step where you looked up available s/ns for the items first, and then married those up with the order shipment data, you could definitely accomplish it
k
Gotcha but the confusing part is I couldn't figure out how I can do a multi lookup of each line item to find the serial lot. Then merge them back as the same payload.
My Input :
Copy code
{
  "exportId": 101010101,
  "order_number": "10",
  "line_items": [
    {
      "sku": "Sku1",
      "quantity": 1
    },
    {
      "sku": "Sku2",
      "quantity": 1
    }
  ],
  "shippingInfo": {
    "tracking_number": "101010101",
    "carrier": "shippo__usps",
    "tracking_url": "<https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=101010101>",
    "created_date": "2023-04-19T22:23:25"
  }
}
My ideal output after look up
Copy code
{
  "shipheroShipmentId": 101010101,
  "order_number": "10",
  "line_items": [
    {
      "sku": "Sku1",
      "quantity": 1,
      "serialLot": "Lot123"
    },
    {
      "sku": "Sku2",
      "quantity": 1,
      "serialLot": "Lot456"
    }
  ],
  "shippingInfo": {
    "tracking_number": "101010101",
    "carrier": "shippo__usps",
    "tracking_url": "<https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=101010101>",
    "created_date": "2023-04-19T22:23:25"
  }
}
a
yeah i see what you mean
hmm
i know i could probably do it using a script hook in celigo
but not sure you would need to - might just be all in how you formulate / map your results from the lookup phase
you'd essentiallly be looking up per line item
k
Gotcha, I've done item fulfillment using suitescript restlet but that was called using a web server, I'm still quite new to the Celigo hooks. One question is what type of script do I use for this case?
I followed their docs, by creating a suitescript inside my cabinet, but I need to specify a type
a
i think it'd be a pre map hook
no i think for this one you could get away w/ doing it entirely inside celigo - no suitescript needed
either postresponse or premap i think
k
I see, but my lookup phase is the blocker, because I still have not been able to do multi look up.
a
what about something like where you map to the SN, using a dynamic lookup there?
like here
message has been deleted
then something like
message has been deleted
k
message has been deleted
I have items with multiple lots.
a
where you basically run an inventory number search and send in the item number
ah yep exactly what i was thinking
k
It gives me error
Copy code
message: A mapping error occurred. More than one match for "[["inventorynumber.item","is","sku1"],"AND",["inventorynumber.location","is","13"]]" for the record type "inventorydetail".
a
you may want inventory number, not inventory detail?
oh i see
k
I can't find an option for me to select single value from dynamic look up
It had to be single result, or it will show that error.
a
crap
k
That's why I need to do a pre step to do a look up on netsuite
a
yeah i get it now
you need a way to do a look up on each line item returned in each record you get from the initial export
k
Yes, I looked up the community forum but I could not find any solution
a
did you try the one to many option?
k
I have not
a
message has been deleted
i think that's probably what you want
then you will search for each line item to get available lots
and select a result
k
gotcha please standby, let me make a lookup step and configure it
a
good luck
k
If my input is
Copy code
{
  "exportId": 101010101,
  "order_number": "10",
  "line_items": [
    {
      "sku": "Sku1",
      "quantity": 1
    },
    {
      "sku": "Sku2",
      "quantity": 1
    }
  ],
  "shippingInfo": {
    "tracking_number": "101010101",
    "carrier": "shippo__usps",
    "tracking_url": "<https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=101010101>",
    "created_date": "2023-04-19T22:23:25"
  }
}
My path to many : line_items
And is this my search criteria?
a
i think that's right
though i often need to do some trial and error to get it exactly
but that looks correct
k
Okay, I'll do some testing around. one moment
I'll update the comment when I encounter issues. Talk soon!
a
👍
k
@al3xicon I can't seem to get additional search criteria working.
I switched to Item search instead of inventory detail to test for that.
@al3xicon I'm on the final step, but I am getting
Copy code
Failed to create, update/transform record because You have entered an invalid default value for this record transformation operation.
a
What does your mapping look like?
k
message has been deleted
message has been deleted
Output :
Copy code
{
  "nlobjFieldIds": {
    "celigo_nlobjTransformId": 5138070,
    "shipstatus": "C",
    "trandate": "4/20/2023 11:35:28 pm",
    "celigo_initializeValues": "celigo_nlobjTransformId"
  },
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "location": 13,
          "itemreceive": "true",
          "itemname": "NCL2.0-5",
          "celigo_inventorydetail": {
            "nlobjRecordType": "inventorydetail",
            "nlobjFieldIds": {},
            "nlobjSublistIds": {
              "inventoryassignment": {
                "lines": [
                  {
                    "issueinventorynumber": "LOTFC2023",
                    "quantity": 1
                  }
                ]
              }
            }
          }
        },
        {
          "location": 13,
          "itemreceive": "true",
          "itemname": "APGX-N-SL-2.0",
          "celigo_inventorydetail": {
            "nlobjRecordType": "inventorydetail",
            "nlobjFieldIds": {},
            "nlobjSublistIds": {
              "inventoryassignment": {
                "lines": [
                  {
                    "issueinventorynumber": "622091-4",
                    "quantity": 1
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}
a
Hmm I'm not sure what it is
Maybe the field you're mapping to lot number
But I doubt that
It looks ok to me, there must be something small missing
k
I see, When i did suitescript I added
Copy code
var fulfillment = record.transform({
          fromType: record.Type.SALES_ORDER,
          fromId: requestBody.id,
          toType: record.Type.ITEM_FULFILLMENT,
          defaultValues: {
            inventorylocation: requestBody.location,
          },
        });
But i added inventory location already.
a
I'd check the community for related posts, otherwise tomorrow I can compare to my mapping and see what it might be
k
okay! thank you
a
here is what my mapping looks like
message has been deleted
k
@al3xicon Is it okay if I see the request you sent to netsuite?
It's interesting, the only thing I can think of is Item line id.
a
it won't run again for me until 4 pm, and i may be gone for the weekend by then
👍 1
here is a sample of a request
Copy code
{
  "nlobjRecordType": "itemfulfillment",
  "nlobjFieldIds": {
    "celigo_nlobjTransformId": 203326,
    "carrierform": "ns",
    "shipcarrier": "nonups",
    "shipmethod": 31,
    "shipstatus": "C",
    "trandate": "4/20/2023 12:00:00 am"
  },
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "quantity": 5
        }
      ]
    }
  },
  "documentIndex": 0
}
by the way, i just realized i forgot to mention a key thing for me is this is a drop shipment item fulfillment i'm creating, against a purchase order
very different if you are creating one from a sales order
k
I see, since the last time we spoke, I figured that our Netsuite enviroment have cross subsidiary fulfillment enabled where we had to put in inventory location as a parameter. But still receieve the same error even though I followed the two post : https://docs.celigo.com/hc/en-us/community/posts/360078501031-FAQ-Why-am-I-getting-t[…]-must-have-at-least-one-valid-line-item-for-this-transaction- https://docs.celigo.com/hc/en-us/community/posts/360061028431-How-to-transform-record-to-Netsuite-
a
i might suggest trying to use Postman to get to the XML you want, you can more easily trial-and-error it out that way
you're missing nlobjRecordType, not sure if that is making a difference
did you try to manually fulfill that order (with the same internal ID) in the UI to make sure you can?
perhaps those lines are already fulfilled or something?
k
Sorry, I forgot to add, I have the recordId and type added. here is my example Payload.
Copy code
{
  "nlobjRecordType": "itemfulfillment",
  "nlobjFieldIds": {
    "celigo_nlobjTransformId": 5138070,
    "inventorylocation": "13",
    "shipstatus": "C",
    "trandate": "4/20/2023 11:35:28 pm",
    "celigo_initializeValues": "celigo_nlobjTransformId,inventorylocation"
  },
  "nlobjSublistIds": {
    "item": {
      "lines": [
        {
          "itemreceive": "true",
          "itemname": "Sku1",
          "location": 13,
          "celigo_inventorydetail": {
            "nlobjRecordType": "inventorydetail",
            "nlobjFieldIds": {
              "celigo_replaceAllLines_inventoryassignment": "true"
            },
            "nlobjSublistIds": {
              "inventoryassignment": {
                "lines": [
                  {
                    "issueinventorynumber": "LOTFC2023",
                    "quantity": 1,
                    "inventorystatus": 1
                  }
                ]
              }
            }
          }
        },
        {
          "itemreceive": "true",
          "itemname": "Sku2",
          "location": 13,
          "celigo_inventorydetail": {
            "nlobjRecordType": "inventorydetail",
            "nlobjFieldIds": {
              "celigo_replaceAllLines_inventoryassignment": "true"
            },
            "nlobjSublistIds": {
              "inventoryassignment": {
                "lines": [
                  {
                    "issueinventorynumber": "622091-4",
                    "quantity": 1,
                    "inventorystatus": 1
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "documentIndex": 0,
  "INTEGRATOR_IO_MAPPER": true
}
a
gotcha, yeah i'm wondering if there's some special thing that needs to be set for cross-subsidiary fulfillments that i'm not familiar with
k
All the information from my UI is the same as payload. I have the following parameter in my payload as from the URL when I create IF from UI. /app/accounting/transactions/itemship.nl?id=5138070&e=T&transform=salesord&memdoc=0&whence=&inventorylocation=13 and Item's are the same line, with location populated.
This is my transform request
Copy code
nlapi calls registered for $R:
r = nlapiTransformRecord("salesorder", 5138070, "itemfulfillment", {"celigo_nlobjTransformId":5138070,"inventorylocation":"13"});
a
this is what i see
Copy code
2023-04-21T20:32:50.186Z	nlapi calls registered for $R	r = nlapiTransformRecord("salesorder", 181882, "itemfulfillment", {});
r.setFieldValue("carrierform", "ns");
r.setFieldValue("shipmethod", 31);
r.setFieldValue("shipstatus", "C");
r.setFieldValue("trandate", "4/21/2023");
r.selectLineItem("item", 1);
r.setCurrentLineItemValue("item", "itemreceive", "T");
r.setCurrentLineItemValue("item", "quantity", 2);
r.setCurrentLineItemValue("item", "line", "1");
r.commitLineItem("item");
r.selectLineItem("item", 2);
r.setCurrentLineItemValue("item", "itemreceive", "T");
r.setCurrentLineItemValue("item", "quantity", 2);
r.setCurrentLineItemValue("item", "line", "2");
r.commitLineItem("item");
nlapiSubmitRecord(r, false, false);
(in this example there are no serial numbers of course)
k
is that your request?
It seems like for me, it is breaking on the initialization of r = nlapiTransformRecord("salesorder", 5138070, "itemfulfillment", {"celigo_nlobjTransformId":5138070,"inventorylocation":"13"});
something in my param is off.
I found it
I got it working, its a new error now
Copy code
nlapi calls registered for $R:
r = nlapiTransformRecord("salesorder", 5138070, "itemfulfillment", {"inventorylocation":"13"});
r.setFieldValue("shipstatus", "C");
r.setFieldValue("trandate", "4/20/2023");
r.selectLineItem("item", 1);
r.setCurrentLineItemValue("item", "itemreceive", "T");
r.setCurrentLineItemValue("item", "itemname", "sku1");
r.setCurrentLineItemValue("item", "location", 13);
sr = r.editCurrentLineItemSubrecord("item", "inventorydetail");
sr.commit();
r.setCurrentLineItemValue("item", "line", "1");
r.commitLineItem("item");
r.selectLineItem("item", 2);
r.setCurrentLineItemValue("item", "itemreceive", "T");
r.setCurrentLineItemValue("item", "itemname", "sku2");
r.setCurrentLineItemValue("item", "location", 13);
sr = r.editCurrentLineItemSubrecord("item", "inventorydetail");
sr.commit();
r.setCurrentLineItemValue("item", "line", "2");
r.commitLineItem("item");
nlapiSubmitRecord(r, false, false);
a
That header field you're initializing is definitely inventorylocation and not just location?
What is the new error?
k
Copy code
Failed to save record because Invalid inventorystatus reference key 1 for issueinventorynumber 128090.
a
Oh nice
k
I tested on the UI, and I have parameter inventorylocation
a
Ok I see
You're much closer now with that error
Maybe that lot number isn't in a Good inventory status
k
ah, gotcha, let me do a few test
I had remove the parameter inventory status from subrecord and it worked.
a
Nice
k
I got item fulfillment created
a
Woo!
k
thank you @al3xicon I'm going to do testing to iron out bugs now
a
Happy you got it working, glad I could help
🙌 1
k
Hey @al3xicon are you having issue with Celigo currently, because our Celigo's error log is not working, just want to get confirmation if it's our end or Celigo's end?
a
Hey, sorry I was off work today so am not aware of any issues
k
👍 alright thank you
Weird that non of our errors is showing up. Today my errors took 2 hours before it showed up
101 Views