UD Customization - Populate Part # based on Job # entered

Good morning Epicor community,

I have a UD customization on a form (UD01) that is almost perfect, based on the criteria that I was given to create it.
I have a few BPM’s that auto fill a field with a record ID, auto time stamps the “Start Time” and auto stamps the user logged in (all three are read only, so they cannot be altered), and when save is clicked, a BPM checks to make sure all the fields on the form are not null, and then time stamps an “End Time.”

The icing on the cake would be for when the Job Number field is filled in, it auto populates the associated Part Number for that job, in the “Part Number” field.

Has anyone ever done anything like this, or have any suggestions on how this could be achieved either with custom code or another BPM?

As always, thanks in advance for all the help you guys provide!

In your BPM, you could add a SetField widget with code similar to:

Db.JobHead.Where( r =>r.Company == _MyCompany_ && r.JobNum ==_jobNumToFind_).Select( r =>r.PartNum ).DefaultIfEmpty("Not Found").FirstOrDefault()

Just replace _MyCompany_ with your company’s code (or better yet the callContext variable), and _jobNumToFind_ with the JobNum they entered elsewhere.

Full topic found here:


1 Like

Thanks @ckrusen.

Would you suggest this route over a BPM that fills table by query?

I currently have a BPM form that prompts the user to input the Job number, and then searches the JobHead table for the associated PartNum and fills it in the desired field.

They’re probably about equal. If you wanted to fetch more that just one field, then the Fill table by query might be more straightforward. You’d only need the one widget.

And to be honest, I don’t use the Table Fill by Query very often, as I’m not real comfortable with it.

1 Like