Bulk Part UOM Update via API

Hi All,

I imagine I’m being an idiot but how would I go about “bulk” updating part UOMs through the REST API?

So far, I’ve been posting through /{currentCompany}/Erp.BO.PartSvc/PartUOMs but, as far as I can tell, this service only accepts one UOM code for one part at a time.

The request body looks like:

{
  "company": "COMPANY",
  "partnum": "PART123",
  "uom_code": "EA",
  "conv_factor": 1.0
}

Is there a way I can send over a bulk request? The request body I’m envisioning would look something like below.

{
{
  "company": "COMPANY",
  "partnum": "PART123",
  "uoms": [
    { "uom_code": "Bag", "conv_factor": 1.0 },
    { "uom_code": "M", "conv_factor": 12.0 },
    { "uom_code": "Mm", "conv_factor": 144.0 }
  ]
}
}

To expand on the above, is it also possible to have it in an array, to allow me to do this across multiple parts at once?

I.e.

{
  "company": "COMPANY",
  "parts": [
    {
      "partnum": "PART123",
      "uoms": [
        {
          "uom_code": "EA",
          "conv_factor": 1.0
        },
        {
          "uom_code": "BOX",
          "conv_factor": 12.0
        },
        {
          "uom_code": "PALLET",
          "conv_factor": 144.0
        }
      ]
    },
    {
      "partnum": "PART456",
      "uoms": [
        {
          "uom_code": "EA",
          "conv_factor": 1.0
        },
        {
          "uom_code": "CASE",
          "conv_factor": 24.0
        }
      ]
    }
  ]
}

I think bulk updates should be done using the DMT for performance/reliability reasons. However, you can always create your own updatable BAQ and/or functions and call them from the API. That should give you plenty of flexibility to update more than one record at a time. Make sure you trace what Epicor calls when you update UOM manually, or you might be missing out on some of that Epimagic.
accuse the hunchback of notre dame GIF

1 Like

Unfortunately this isn’t an option in our case as we wanted a way for end-users to do certain calls without being overwhelmed by the “technical” side of Kinetic.

We’re going down the web app / program route but unfortunately it does make it harder.

Fortunately, I figured out the solution to this issue - despite it not throwing an error, my JSON body was malformed and was missing the company and part_num inside the UOM array during the {currentCompany}/Erp.BO.PartSvc/Parts call, causing it to use default values.

uBAQ + API is a nice sweet spot. Minimal effort, does all the right things, can be called externally.

Thank you both for your replies.

I’ll have to give uBAQs a try!

Have you not run into the myriad of roadblocks that happen when trying to change a UOM? Just about any other record that references the P/N will prevent changes. Specifically any parttran records.

Or has Epicor finally made UOM changes easy?

Surprisingly no roadblocks on Epicor’s side.

The UOM change seems to be working as intended, with the exception of not telling me if I was missing some fields when done via the API.

That said, I know we have a lot of bespoke cusomization so it could very well be because of that.

Ha, no! 5 years, 312 votes, and Epicor isn’t sure if there is enough interest yet… It’s the #5 “gauging interest” Idea on the portal.

Because this is dealing with part-specific UOM conversion, then maybe it is more forgiving (aka the developers forgot to mess that up, too).

1 Like