uBAQ - JobOpDtl, Value cannot be null, Parameter name: fromItem

Hello,

I created an updatable BAQ to update a field in JobOpDtl table. When testing the update of a row, I get this mysterious error.
image

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.

@SteveFossey I am using a standard Epicor BO (JobEntry.UpdateExt). I don’t know what Epicor does in its code.

@Banderson Updatable BAQ works fine even if I have added JobOper.StartDate and JobOper.DueDate. (Epicor Version 10.2.500)

The error you have is probably related to the Before Image Epicor (in some cases) uses prior to an update. Could you post your uBAQ?

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?

1 Like

@louis.fequet @Asz0ka You both are right.
I found two new conditions.

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.

This is my BAQ : JUL_JobsIngenierie_v8.baq (90.0 KB)

You could also see the problem by using this more simple BAQ [UpdateResourceID.baq (31.5 KB)] and doing ONE of the following :

  1. Add either JobOper.StartDate or JobOper.DueDate to the display fields, then update a Resource Group on an unscheduled job;
  2. Create a UDF for JobOper table, add it to the display fields of the BAQ, and try to update a Resource Group on any job.

@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.

I may have misunderstood, but I think you are confusing JobOper, JobOpDtl and JobResources.

JobOper is where you select an Operation. Default operation resources are automatically added to “Scheduling Resources” tab.

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).

@vingeance yes, I was typing too fast. I opened up my ubaq that does this and it is JobOpDtl. The resources are in the ResourceTimeUsed table.

To your issue. To bring in a null date and actually update if I think you would have to set it to something in GetList so it did not error out.

Not familiar yet with Method Directives, but I will try your suggestion.

@vingeance,

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.

1 Like

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.

Pas de trouble!

1 Like

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.

Have a great day.

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

1 Like

Hi there,

Sorry for digging up old topic but I’m having the exact problem that you described here. May I ask how did you resolve the issue? Thanks

Hey Dan,

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.

Thank you Adam! Appreciate your reply here, have a good night and hopefully you can refresh your memory :slight_smile: