Are Epicor Widgets Broken? šŸ¤

I have come to the conclusion that invoking BO Objects especially the ones that do an Update are broken. They yield incorrect results and have been forever. I couldnā€™t imagine a world without Custom Code you would be dead in the water for any serious customization.

But even more frustrating for the community that Epicor doesnā€™t mention ā€œBefore Imageā€ in any of their guides or at Insights for a decade that Iā€™ve been around.

Typical Behaviour when Epicor does an Update

It sends Modified Row with a RowMod ā€œā€ (blank) and RowMod ā€œUā€ which allows you to use conditions such as ā€œIf field changed from x to yā€ among other things.

When you use Widgets Epicor obviously never creates the ā€œBefore Imageā€. You can create it just fine when you do Custom Code.

var dsInvoice = bo.GetByID(row.InvoiceNum);
var originalRow = dsInvoice.InvcHead.NewRow();
BufferCopy.Copy(dsInvoice.InvcHead[0], originalRow);
dsInvoice.InvcHead.Add(originalRow);

You could probably do that with nightmarish widgets as well by cluttering your flow with a bunch of nonsense

In addition when Epicor does updates it sends only the tables modified to your PRE, when you do an Update via a Widget you get the entire dataset, which is fine - just keep in mind not to rely on that.

Lastly, Sometimes you need to do an Update in a POST and Epicor doesnā€™t have a Widget approach to ignoring facades but you can do that just fine in code and avoid the circular loop of death.

When you use Ice.Assemblies.ServiceRenderer.GetService(Db, true) you are also setting the ignoreFacade to trueā€¦ What is a Facade in Epicor? Well if you use the ICE SDK and you create your own Business Objects you always create a SvcFacade.cs file which contains the required code for interacting with BPMā€¦ So by setting ignoreFacade to true you are basically sayingā€¦ Do Not Trigger the ā€œUpdateā€ BPMā€¦ perhaps you want it, but if you are in the Update already you would cause a loop.

Lets not even start with loops

Loops in Widgets are the worst.

Joining ttTable to Db Table

This is considered a crime and should be thought to be avoided at all costs.

Changed Includes Delete

In Epicorā€™s custom code guide they state that Changed = Add/Update but it also include Delete so you are better of using Added or Updated individually instead of Changed. Their Guide is wrong its not just Added or Updated.

Conclusion

Iā€™ve done Custom Code for many years and have been giving Widgets a try lately, only to stumble upon limitations and limitationsā€¦ For example RcvMisc.RowMod isnā€™t accessible via Set Field but you can set it fine via Custom Code. That among many other things simply seem not to be getting any love from Epicor.

Stuck in 1735

Also why are we still stuck on C# 6 compilation; canā€™t even use ValueTuple :slight_smile:


What are your favorite widgets gotchas?

6 Likes

Haso, I had some this past year as I tried out using functions and tracing business processes.

I forgot to write them down and it would take me a minute to work back through the flow and understand it again, but I can say I agree with the looping aspect.

I wish we could loop somehow, but nah.

1 Like

And Haso, I havenā€™t come across anything that needs the ā€œBefore Imageā€ yet.

Iā€™d like to experience this.

What business object method would you suggest I use to experience this?

Was RowMod an Epicor idea? Doesnā€™t ADO .Net DataSets use RowState? Canā€™t we use RowState now too? :thinking:

2 Likes

Wait there is moreā€¦

If you use a condition such as if abc changed from x to yā€¦ then the next condition canā€™t do it anymoreā€¦ Epicor will strip the RowMod ā€œā€ (blank) out - by filtering it out.

Itā€™s @jgiese.wci favorite by design feature :wink:

1 Like

When you have to use Custom Code just for RowMod or the following BO doesnt work :slight_smile:

1 Like

I think I do have a custom code widget to set it to U if I recall correctly :rofl:

I donā€™t know what you are talking about.

1 Like

I see we have a Update Table By Query fan :smiley: yikes :slight_smile:

Yes hahaha, but itā€™s updating the dataset variable in the BPM, is that poor processing Haso?

This was one of the first times I tried tracing and doing a widget based replication of the trace.

It works but the code it generates is definitely slow. Wish they could just fix Set Field :slight_smile: Until then Iā€™ll keep using Custom Code (on prem).

1 Like

Yeah, maybe that is the bug (design feature) that you were pointing out and thatā€™s why I had to do the update by table widget over and over.

Haso I was trying anything to get the RowMod to stick and this finally worked so I donā€™t know what to say.

Man, even I gave up on widgets for the RowMod, and I am Mr. Anti-code. Itā€™s actually EASIER to read

MyDataset.LaborDtl[0].RowMod= "U";

than it is to set up and troubleshoot the fill table widget.

2 Likes

Yeah I just was trying my hardest to not custom code.

1 Like

Just to be clear, youā€™re replacing all of the those RowMod updates with a single Custom Code block or are we just swapping out Update by Query for a Code Block? :thinking:

(Except for the poor old MT users, code blocks work in Public Cloud or Single Tenant. :wink: )

1 Like

I get it but I donā€™t like it lol! Oh well Enable Post Process for the win.

Honestly, Iā€™m an uneducated script kiddie and it wasnā€™t a big deal to go from ā€œVBA for dummiesā€ to ā€œC# for dummiesā€. Okay, without this forum Iā€™d have been dead but frankly, so would Epicor themselves.

Itā€™s been tough to learn the principles and there are some gotchas but they could strip the widgets from the codebase tomorrow and weā€™d be fine. They really just make for impressive sales presentations to show managers who love flowcharts.

With Efx itā€™s even better, once you realize that @SAD is right - theyā€™re never going to really document everything.

Speaking of flowcharts, one of the best things about c# is that managers think itā€™s terrifying - so before you start solving, you can more or less force them to actually map their processes and understand what theyā€™re trying to change. This is an ongoing battle but easier with nothing visual to show them :grin:

1 Like

I donā€™t know man, I think the closer Epicor can get to no/low code customization, the better they are going to sit in the marketplace. The ultimate goal of no/low code is to bring the technology closer to the unwashed masses.

This benefits the technical people by not bottlenecking the entire process into their to-do list. A tool to visually configure and orchestrate the business process automation is worth more than a bunch of complex code that only a developer can read and maintain. This is coming from someone who is indeed a developer and a manager.

Itā€™s arguably more wise to use ones communication skills to garner understanding and implement successful technology (independent of a specific tool) across the organization rather than intimidate with the use of said tools. Complexity and skill in making a solution isnā€™t what makes it a good one; only in what it does for the business matters.
I would like of course to see every business process documented in a flowchart. Maybe someday :wink:

4 Likes

I do like what youā€™re saying overall, but I also think well written clean code is easier to read and maintain than widgets. With widgets, especially if youā€™re doing something complex, you are constantly clicking in and out of different expression editors and can only see one thing at a time. You have to hold so much in your working memory, itā€™s a nightmare. With custom code, everything is right there in front of you on one screen (ideally).

4 Likes