Need Help Debugging

Hello All,

I got mostly through tracing a method and so far I have been able to pass a table set variable into the BO methods for inventory transfer.

But then I got to InvTransfer.ChangeFromWhse.

If takes two parameters and I pass them both in accordingly, but then I get a:

BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.

Is there any way to “see more info in the inner exception section of Exception Details?”

How do I troubleshoot this further to see where the issue is.

Here is my BPM so far. I am writing it on ABCCode.Update Post processing which may seem weird, but I just wanted to tray and create an inventory transaction from one place in the application that wasn’t inventory transfer.

Look in the Event Viewer for the AppServer. First guess is the ds needs to have both a before and after record for the expected change.

1 Like

I looked in the event viewer yesterday before I posted this, all I saw was the same error message detail.

I also tried the PDT tool and read the server log. I saw something similar.

How do you pass a before and after record to the method when it only accepts one data set?

Do you think that it is some value in the dataset that is null that shouldn’t be?

I don’t see this in the trace.

Server Side Error
Server Side Exception
EpicorServerException
	Correlation ID: 7d9c1eb0-5c06-4c6f-a3f4-3785b25f47a1
	Description: BPM runtime caught an unexpected exception of 'NullReferenceException' type.
See more info in the Inner Exception section of Exception Details.
	Program: Erp.Services.BO.InvTransfer.dll
	Method: ChangeFromWhse
	Line Number: 422
	Column Number: 21
	Original Exception Type: NullReferenceException
	Server Trace Stack:    at Erp.Services.BO.InvTransferSvc.ChangeFromWhse(String ipwhseCode, InvTransferTableset& ds) in C:\_Releases\ERP\UD10.2.500.8\Source\Server\Services\BO\InvTransfer\InvTransfer.cs:line 422
   at Erp.Services.BO.InvTransferSvcFacade.ChangeFromWhse(String ipwhseCode, InvTransferTableset& ds) in C:\_Releases\ERP\UD10.2.500.8\Source\Server\Services\BO\InvTransfer\InvTransferSvcFacade.cs:line 128
   at Epicor.Customization.Bpm.BOA293E45DF85347C895E26043110BA8B2.UpdatePostProcessingDirective_Test_9DE98990A53C41139474B1767676C577.A009_InvokeBOMethodAction()
   at Epicor.Customization.Bpm.BOA293E45DF85347C895E26043110BA8B2.UpdatePostProcessingDirective_Test_9DE98990A53C41139474B1767676C577.ExecuteCore()
   at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 146

I might be way off here… I recognize that message. I think it pops up when I haven’t defined a dataset, or populated it correctly. I can’t say what you should use, but I have fixed this by using a GetDatasetForTree, or some other version of Get right before your offending widget.
Good luck!

Thank you Nate! Yeah I have traced this inventory transfer and I see it calls GetNewInventoryTransfer then GetTransferRecord. I am assuming you should pass the same dataset through all of them so that it can change it as it moves through the process (hence the in-out). Then I pass it through the ChangeTransferQty method and the dataset goes through that just fine… It isn’t till the ChangeFromWhse method that it barks.

I am trying to figure out what my dataset looks like before and after each method right now.

That is an easier one. Inset a message box widget and use the table query to display the tableset. I use this all the time! If your workflow is failing before the message box displays, just cut out the offending widget temporarily so that the workflow can run.

Thank you for that tip!

I would like to practice converting it to JSON or something similar. It would also be nice if I could get it to output as xml so I can do a quick comparison between that of my trace and this bpm.

What do you mean a before and after record for the expected change?

I do see that in the ChangeFromWarehouse method the pre processing dataset is only one set of data and then the post processing the dataset is duplicated, once with the before values and once with the changed.

However, I also noticed that in the preprocessing dataset, the rowmod is “u”.

I see that the dataset before all of this doesn’t have a rowmod value… could this be my problem? Do I need to edit the dataset and add a value there before passing it to the ChangeFromWarehouse method? I will see what I can do here. Can I do this with a widget?

Pre Processing

XYZ,5/6/2021 12:00:00 AM,MI-E2,D - East Coater D Area,MI-E2,D - East Coater D Area,D1,Warehouse D Bin 1,0,0,MfgSys,MfgSys,03-102,False,False,True,partdesc,something,MfgSys,False,MfgSys,False,GL,0,GL,GL,GL,0,0,0,0,False,0,0,0,0,eadcb3dc-e0a9-40bf-9ebd-1c969ef45872,U

Post Processing

XYZ,5/6/2021 12:00:00 AM,MI-E2,D - East Coater D Area,MI-E2,D - East Coater D Area,D1,Warehouse D Bin 1,D1,Warehouse D Bin 1,0,0,MfgSys,MfgSys,03-102,False,False,True,partdesc,something,MfgSys,False,MfgSys,False,GL,0,GL,GL,GL,0,0,0,0,False,0,0,0,0,eadcb3dc-e0a9-40bf-9ebd-1c969ef45872,
XYZ,5/6/2021 12:00:00 AM,MI-E1,F - East Large Raw,MI-E2,D - East Coater D Area,FW05,Warehouse F Bin FW05,D1,Warehouse D Bin 1,1014.39000000,0,MfgSys,MfgSys,03-102,False,False,True,partdesc,something,MfgSys,False,MfgSys,False,GL,0,GL,GL,GL,0,0,0,0,False,0,0,0,0,eadcb3dc-e0a9-40bf-9ebd-1c969ef45872,

EDIT Thank you @NateS for showing me the message widget with table query. I was able to identify that I needed to update the dataset and add a rowmod value of “u” before passing the dataset to the changefromwarehouse method.