Find Line Number in BPM custom code causing error

Our company had a BPM written for us by a consultant which is throwing an error. I’ve found a data directive with custom code on the Erp.RcvDtl table. Is there a way to find out which line of that custom code is throwing the error?

We are on premise if that matters.

1 Like

You could paste the code into a chatGPT if there’s nothing proprietary in there and ask it the same question, then take what it gives you back and post it here to confirm with the other experts.

Without any knowledge whatsoever, I usually start commenting out chunks of code until I cause the error to stop happening. Then look in that chunk of code for something (in this case) that is going to return a null value when it’s not going to accept a null value.

4 Likes

You can find the code on the server in:
%WWW%\%Instance%\Server\BPM\Sources\DT\Erp.RcvDtl.Triggers\#\%TranType%.%DirectiveName%.cs

1 Like

good advice

Can you paste the code here? We’ll see if we can spot the flaw.

1 Like

I was going to advocate doing that too!

I usually add in Ice.Diagnostics.Log.WriteEntry with things like past customer or you can just number them. then in the server event viewer or the ServerLog file you can see how far you got.

If I get approval to post the code I will, but I don’t think that will happen.

Thanks for all the advice. It sounds like it takes code analysis or trial and error to find the offending line. Seems a bit primitive, but I guess that’s the way it is because of the way custom code is integrated into Epicor.

Hopefully by now someone has submitted an Epicor idea to make this better? I’ll go vote for that right now if someone can point me in the right direction.