JmgJobBundle.addJob Method [AX 2012]
Adds a job to the job bundle.
public void addJob(JmgJobTable _jmgJobTable, [JmgRegistrationParameters _regParameters])
Run On
CalledParameters
- _jmgJobTable
- Type: JmgJobTable Table
A JmgJobTable record, which refers to the job to add to the bundle.
- _regParameters
- Type: JmgRegistrationParameters Class
The registration parameters, which is used when a registration is created on the job.
An error is thrown if the bundle has already been committed or if the job cannot be added to the bundle because of an invalid job combination. Being already committed means that if the makeRegistrations method has been called. Jobs cannot be bundled. If the job has already been added to the job bundle one time, nothing occurs.
Only production jobs can be bundled. Hence, an error is thrown if, for example, a production job is added first, followed by a project job. Jobs can also be added by using the addTermJob method.
The following example makes registrations for the specified employee on two production jobs.
JmgJobBundle jmgJobBundle;
jmgJobBundle = new JmgJobBundle(jmgWorkerRecId);
jmgJobBundle.addJob(JmgJobTable::find('100000123'));
jmgJobBundle.addJob(JmgJobTable::find('100000124'));
jmgJobBundle.makeRegistrations();
// This line will result in an error being thrown.
// Registrations for this bundle have already been made.
jmgJobBundle.addJob(JmgJobTable::find('100000125'));
Community Additions
ADD
Show: