Updating a Case Order Number via Function

I am attempting to create a Funciton to update a case through widgets. I am able to get the fields to update via HelpDesk.UpdateExt. My biggest headache is getting the Order default information to repull if it is changed. My current setup is a FillTableByQuery into a ext tableset with RowMod = “U”, then I update the fields I need and call UpdateEXT. I’ve tried with just a normal HelpDesk.Update, but then the order fields dont update at all. It seems like UpdateEXT is defaulting to No when prompted to pull in the defaults. I’ve tried running a GetByID after the Update to run the OnChangeOrderNum BO Method, but I get a “No modified record found.” error. Any help is appreciated!

Before calling that on change you need to dirty one row (RowMod= “U”) - this would be the row OnChange is looking to affect.

I used a Fill Table By Query to set the RowMod on the HelpDeskTableset while pulling in the Order Fields, then called the OnChangeOrderNum method, then the Update. Now I’m getting back a “Row has been modified by another user and couldn’t be updated.” error.

I created a case with Epicor Support and they cant provide a path yet either. Starting to wonder if this just is not possible?

Personally, I find the “Set Field” widget is more reliable than Fill by Query. If I’m setting more than a handful of fields, I switch to a custom code block for ease of use. I just don’t use Fill By.

My current version that is working the best is using the Set Field widget, then running UpdateEXT. That is updating the fields and saving it, but its not pulling in the correct related to Order info. I cant run OnChangeOrderNum because it only takes the HelpDeskTableset, but the only way I can get data to update is with a UpdExtHelpDeskTableset.

I had a situation like that (specifically, auto-closing maintenance jobs when the last op was completed). Neither Update nor UpdateExt was working reliably. I eventually used an updatable BAQ and called it from the BPM.

LINK

I did it in code, but I believe it’s possible to accomplish the same via widgets. I admit now, as I did then, that this is a bit of a cludge. But I had a deadline and I knew it would work.

I’ll also note that, structurally, there’s usually nothing different between a NormalTableset and a UpdExtTableset. You can usually copy the rows from the former to the latter and it should work. However, UpdExtTablesets don’t require nearly as many fields. So you can also just create a UpdExtTableset local variable, add a row with only key fields + what you want to change, and pass that into UpdateExt.