I created an updatable BAQ to update a field in JobOpDtl table. When testing the update of a row, I get this mysterious error.
I finally found that having JobOper.StartDate and/or JobOper.DueDate in selected display fields leads to this error.
I read this thread on the forum and downloaded from the following post a basic uBAQ where you can change the Resource Group on a JobOpDtl.
The uBAQ is working fine, but again, as soon as I add JobOper.StartDate and/or JobOper.DueDate to the display fields, I get the same mysterious error. Checking “Allow Nulls” for both fields in Update Processing does not work.
Any help would be appreciated. Tell me if you need more detail.
In your BAQ are you testing for nulls anywhere? I have run into a weird one 3 times (twice in C# BPM and once in a BAQ) where I’m testing for Null and when I actually get a null, it fails with a NullReferecenException.
In C# I had to go if ( thing.Any() ) instead of if (thing != Null) but in a BAQ it’s trickier, and I never found a way to make it work. The most frustrating thing is it doesn’t happen every time I try to test for Null, but when it does it’s very persistent.
I’ve seen this error before, but it was related to an individual job (not all jobs). In my case, we were unable to mark a job operation as “final” because the job’s original final operation had been deleted. This error about the fromItem would get thrown. Is this error showing for all jobs you try to update or one in particular?
First, the error is thrown only if the job has not been scheduled AND either JobOper.StartDate or JobOper.DueDate field is displayed.
Second, the error is always thrown if I add a user defined field (JobOper table, decimal type, defaults to 0.00, not required) to the display fields.
@vingeance Do the JobOpDtl records even exist on the unscheduled job?
On an job that has not been scheduled I set the JobOper fields to the resource group and then let scheduling create the JobOpDtl records in that resource group.
JobOpDtl is where you can change the default Resource Group (or Resource, …) which will be used by the scheduling process (input). This is what I am trying to achieve in the BAQ.
JobResources are the Resources automatically selected by the scheduling process (output). In my case, there is no entry because the job is not scheduled yet. My BAQ should not even use this “table” (I don’t even know if it’s a table. I can’t find it in Data Dictionary Viewer).
1- I have create an updateable BAQ and an unscheduled job. I have updated with success the ResourceGroup.
2- I’ve added JobOper.StartDate and JobOper.DueDate and I was able to reproduce your error. Seems like an BeforeImage (missing) error on JobOper.
3- I have created 2 calculated fields (date format) one for each of the desired value (JobOper.StartDate and JobOper.DueDate). The update succeeded.
The idea was to kidda “mislead” Epicor by removing native JobOper fields in order to not trigger any comparaison with a BeforeImage missing. Using calculated fields did the job.
Awesome! Never would have thought to do that. Thank you!
It works great for fields you just want to display (knowing both these dates should only be set by the job scheduling). However, how would you make it work for a field you need to update?
I have created a decimal UDF for JobOper table and I need it to be updatable. I get the same error when the field is displayed.
Depending on the dashbard layout you want, maybe you could consider presenting your data in two grids. The publisher grid would contain information regarding your operations and the subscribing grid would present the JobOpDtl. I did not test it …
YOU are awesome. A publish-subscribe dashboard with one uBAQ on JobOper and another one on JobOpDtl works like a charm. Looks like Epicor JobEntry BO cannot update JobOper and JobOpDtl fields at the same time.
Thank you for this! I was having the same issue and pulling my hair out trying to resolve.
Just wanted to add as well, you can write your own base update method using two separate JobExtJobEntryTablesets one for job Opr and the other for job OpDtl and that will work for updating from the same table without having two uBAQs
I can’t remember exactly, I may need a closer look when I get to a computer. But I believe I was able to see the problem on the tables in a BAQ, then manually update the final operation with a ubaq on updateext.