JmgTermJob.init Method [AX 2012]
Part of the initialization procedure of an instance. The method is called by the JmgTermJob::construct Method and JmgTermJob::constructJobTable Method.
Syntax
protected void init(
JmgJobId _jmgJobId,
JmgJobTable _jmgJobTable,
Common _sourceData)
Run On
Called
Parameters
- _jmgJobId
Type: JmgJobId Extended Data Type
ID of the job.
- _jmgJobTable
Type: JmgJobTable Table
A JmgJobTable record that contains information about the job.
- _sourceData
Type: Common Table
A record that contains the data upon which the job is based, such as a ProdRouteJob record, a ProjActivity record, a JmgIpcActivity record, and so on.
Remarks
This is a protected method. Only call it from the JmgTermJob::construct Method and JmgTermJob::constructJobTable Method methods.
Examples
The following example shows how the init method is used in the JmgTermJob::construct Method.
After the JmgTermJob object is created, the method is called to initialize the object.
// From Classes\JmgTermJob\construct
static JmgTermJob construct(
JmgJobId _jobId,
boolean _forUpdate = false)
{
JmgJobTable jmgJobTable;
Common jobTable;
JmgTermJob ret;
;
jmgJobTable = JmgJobTable::find(_jobId, _forUpdate);
if (jmgJobTable)
{
ret = JmgTermJob::constructJobTable(jmgJobTable, _forUpdate);
}
else
{
jobTable = JmgTermJob::commonJob(_jobId, _forUpdate);
switch (jobTable.TableId)
{
case tablenum(ProdRoute):
case tablenum(ProdRouteJob):
ret = new JmgTermJob_Prod(_forUpdate);
break;
case tablenum(ProjTable):
case tablenum(ProjActivity):
ret = new JmgTermJob_Proj(_forUpdate);
break;
case tablenum(JmgIpcCategory):
case tablenum(JmgIpcActivity):
ret = new JmgTermJob_IPC(_forUpdate);
break;
case tablenum(HRMAbsenceCodeGroup):
case tablenum(HRMAbsenceCode):
ret = new JmgTermJob_HRMAbsence(_forUpdate);
break;
default :
ret = new JmgTermJob_illegal();
break;
}
ret.init(_jobId, jmgJobTable, jobTable);
}
return ret;
}