In Epicor 10, In a customization I’m trying to call JobEntryAdapter.ChangeJobHeadJobReleased. I have the following:
using (JobEntryAdapter jobEntryAdapter = new JobEntryAdapter(this.oTrans))
{
jobEntryAdapter.BOConnect();
JobEntryDataSet ds = jobEntryAdapter.JobEntryData;
jobEntryAdapter.ChangeJobHeadJobReleased();
}
The Trace Log says that ChangeJobHeadJobReleased needs a parameter of JobEntryDataSet. However, the ChangeJobHeadJobReleased method doesn’t accept any arguments. How do I pass in the parameter to the method?
You’ve created the adapter instance but you haven’t selected any specific record set. You’ll want to call a GetByID method first before you attempt to call the ChangeJobHedJobReleased method, since it doesn’t know what records to apply that method to.
If I add jobEntryAdapter.Update(), the job is updated correctly, but it’s now using the Update method instead of the ChangeJobheadJobReleased method so this wasn’t really what I was trying to do.
The Trace Log uses paramDataSetChanges which I don’t understand how to re-create:
It might be helpful if we knew the entire problem / automation that you are attempting to resolve/do… What is supposed to trigger this logic? Are you trying to auto release the job? Where are you putting this?
Thanks Brian, I do have it working with Update but this does not call ChangeJobHeadJobReleased() the way the Job Entry screen does. I thought it was best practice to call the same methods that are doing actions, rather than just updating the field.
Tim ~ I’m just trying to unrelease a job using a button in a dashboard at this point, and understand how to call these adapters in general.
Aaron ~ if I call the ChangeJobHeadJobReleased after Update(), I get a JobHead has not changed. message, presumably because it has already been updated and now there are no pending changes.
I think you might need to set JobReleased to true/false in your data row edit, call the update method. I’m not sure you need to call that method at all, but I could be wrong. Sometimes I’ve noticed that it’s not always necessary to call every method that the UI would invoke when using the business objects.