Error running UBAQ Export to run code

We created a UBAQ that executes correctly when run “manually”. it also runs from a dashboard.
BUT, when you try to run it in the Export BAQ process, it throws an error.
The BPM code is in the GetList.Post process in the UBAQ code. if I turn off the BPM, then the error doesn’t get thrown… Here is the error:
Any clues… we even commented out all the code in the BPM, and it still throws the same error.

Exception occured:
System.ArgumentNullException: Value cannot be null.
Parameter name: tableset
   at Epicor.Customization.Bpm.TablesetWithFilter`1.Attach(TTableset tableset, Boolean asCurrent) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\Lib\Epicor.Customization.Bpm\TablesetWithFilter.cs:line 40
   at Epicor.Customization.Bpm.Ubaq10C1157840674F13B4EEC02625E00D94.GetListDirectiveBase.InitializeCore(GetListParameters parameters, Boolean preparation)
   at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 141
   at Epicor.Customization.Bpm.MethodCustomizationBase2`3.<>c__DisplayClass20_0.<RunDirectives>b__5(MethodDirectiveBase`3 dir) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\Lib\Epicor.Customization.Bpm\MethodCustomizationBase2.cs:line 208
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Epicor.Customization.Bpm.MethodCustomizationBase2`3.RunDirectives(TParam parameters) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\Lib\Epicor.Customization.Bpm\MethodCustomizationBase2.cs:line 212
   at Epicor.Customization.Bpm.CustomizationBase2`3.Execute(TParam parameters) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\Lib\Epicor.Customization.Bpm\CustomizationBase2.cs:line 73
   at Epicor.Customization.Bpm.Ubaq10C1157840674F13B4EEC02625E00D94.CompanyID_SO_JsonProcessorSvcCustomization.GetList(DynamicQueryTableset queryDS, QueryExecutionTableset executionParams, Int32 pageSize, Int32 absolutePage, Boolean& hasMorePage)
   at Ice.Services.BO.DynamicQuerySvc.TryExecuteUpdatableQuery(DynamicQueryTableset queryDefinition, QueryExecutionTableset executionParams, DataSet& result) in C:\_Releases\ICE\ICE3.2.200.5\Source\Server\Services\BO\DynamicQuery\DynamicQuery.Impl.cs:line 1180
   at Ice.Services.BO.DynamicQuerySvc.ExecuteByID(String queryID, QueryExecutionTableset executionParams) in C:\_Releases\ICE\ICE3.2.200.5\Source\Server\Services\BO\DynamicQuery\DynamicQuery.cs:line 84
   at Ice.Services.BO.DynamicQuerySvcFacade.ExecuteByID(String queryID, QueryExecutionTableset executionParams) in C:\_Releases\ICE\ICE3.2.200.5\Source\Server\Services\BO\DynamicQuery\DynamicQuerySvcFacade.cs:line 121
   at Ice.Internal.XA.BAQReport.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ICE\RL3.2.200.0\Source\Server\Internal\XA\XABaqExport\BaqExport.cs:line 46

You mention you are using this for code. Is it returning at least one row? If not, and the code has no bearing on the rows, simply do a top 1 query of any table for the base baq.

it DOES return a row when running manually.
the error happens when you run through Export… you see this error in the export file, as well as in the History Tasks in the system monitor.

The error goes away when the code is disabled? It appears you are using a FirstOrDefault(), is there some bit of code after that which isnt checking for null there? Also, it looks like you might have overriden the base of the GetList, that could be causing an issue, can you not place the code Before or After the base?

took out all code… simply having THIS throws the error… but if i disable THIS, it does NOT throw the error, and outputs the values:image

I feel like it’s because the export is expecting something to happen in the base code. I dont know what that something is though. If you move your code to pre or post, does it work?

Nope… if I put something in the c#, it also crashes with the same error… note that I only took out all the code to prove that it was not the code crashing. Also note that running the BAQ manually does NOT cause this error. It ONLY happens when run through the EXPORT program. @josecgomez I believe you have created export ubaq… have you experienced this?

I have created and use this often, I’ve had no issues, what version?

version is 10.2.200.5 - We have the code in the “post processing” section so that the initial query retrieves the records we want to process… then we have code to do the processing… but I also tried writing some code in BASE just to see if it would run… but it doesnt either, throwing the same exact error.

I am having the exact same error with the exact same scheduled UBAQ export in 10.2.100.43. Did anyone figure out a fix to this?
Please help ! ! !
Thanks,
Richard

Facing same issue on Epicor version 10.2.100.28. Curious if this has been solved by someone?