Widget Function not writing to database

As we migrate our classic customizations to Kinetic, I’m trying to force myself to use widgets instead of code. I figure they will likely weather upgrades better. That said, I have a really simple function that I cannot for the life of me figure out why it’s not writing back to the database. The function is intended to change the primary bin location for a part.

The function has 3 steps.

  1. Invoke BO method - GetByID(PlantWhseDS)

  2. Update Table Query - (PlantWhseDS) with new bin location

  3. Invoke BO method - Update(PlantWhseDS)

Using Postman, the function runs without error (nothing in the server event log either). I have verified that the PlantWhseDS dataset gets loaded correctly with the new bin location, but nothing seems to be written out to the database.

DB Access from Code is set to Read Write even though I’m just using widgets.

The widgets will break more often than the code. Anything more than 3 or 4 widgets is a nightmare to debug or understand.

3 Likes

Can confirm. Just upgraded from 2024.2 to 2025.2 this weekend. Out of our 100+ functions, 1 of them broke when they added a parameter to JobEntrySvc.GetNewJobProd. It was a widget function.

I keep hearing people say that widget functions are more upgrade ready, but in reality they aren’t any better than a code function. Stick with a code function with some nice comments so people so the next guy can understand what you were thinking.

To answer your question, you are likely just missing setting the RowMod to “U”.

5 Likes

Um, your code is going to break here too if you’re missing a new parameter - widget or not. Reflection and direct file access is breaking in code now, but widgets don’t allow that behavior. I don’t think either camp can declare upgrades are smoother anymore.

:person_shrugging:

1 Like

Service won’t update using code either, if RowMod is not set

1 Like

Correct, but you can easily add the new parameter. With a widget, you have to delete it and start over.

4 Likes

I think what I’m trying to say is that is that there’s no way a widget function can upgrade on it’s own in most cases, so what’s the point? I’m going to have to fix my customizations when I upgrade anyway. There’s many more advantages to having a readable function.

1 Like

And I still don’t understand why after so many years of “widgest are our future!” they don’t have a “refresh signature” button that adds or removes any changes without blowing away the settings you have and then let you be able to adjust from there instead of having to start from scratch. Some of the BO’s (like updateEXT) are a BEAST to set up, and you really don’t want to have to start over if one tiny thing changes.

1 Like

If only there was a place to report this :thinking:

2 Likes

Ideas portal? I keed, I keed

2 Likes

For whenever someone get’s around to approving the idea, here’s the number for the new idea. (I can’t believe 1. that I even have to make an idea for something so obvious, and 2. that there isn’t one already out there). But anyways, it’s idea:

KIN-I-7360

3 Likes

You are right, it is obvious, but I did not think about it.
Also, not sure how trivial this is but it is doable for sure.

1 Like

Do you think we’ll look back at the widget vs. code debate with a quaint smile when we won’t be using either because an AI agent will turn our business rules directly into code?

:thinking:

3 Likes

Firstly, I surely didn’t intend to cause a widget vs code debate. Everyone’s points are valid. Our world is not perfect.

I thought that too, but when I set the RowMod = “U”, the function fails to complete with a server error “Object reference not set to an instance of an object”. I’m likely missing something obvious there.

I am not familiar with the PlantWhseSearch BO. But it looks like you can’t update a primary bin with it. What if you try and use Part BO instead?

1 Like

Man, I missed it!

Agreed. Quite frustrating to delete and readd.

Like in the move to 2022.2, JobEntry.GetRows added 3 new where clauses to the existing 25. So I had to redo every one of these where clauses.

And if it was one EFx, fine. But if you have a dozen that use that BO/method, ugh.

2021 :backhand_index_pointing_up: 2022 :backhand_index_pointing_down:

1 Like

Yup, that did the trick. Happily accepted the RowMod = “U”. Thank you.

Now, to spend the rest of the morning to decide Widget vs Code…

2 Likes

Its debatable if its a good thing or not, but its a lot easier to get AI to help with code than it is widgets..

3 Likes

On that note, am I the only one that feels searching for Epicor related help via Google is yielding less useful information in favor of the AI Overview stuff?

Google search results were going down the tubes before AI, but it does seem to be accelerating the decline.