JmgExternalTerminalData.validateProdJobIdStart Method [AX 2012]
Occurs when the registration is a start job on an production job. Part of the validation algorithm.
Syntax
private JmgExternalTerminalError validateProdJobIdStart(JmgTermJob _jmgTermJob)
Run On
Called
Parameters
- _jmgTermJob
Type: JmgTermJob Class
An instance of the JmgTermJob class, which represents the production job.
Return Value
Type: JmgExternalTerminalError Enumeration
The result of the validation.
Remarks
The following error values are returned:
JmgExternalTerminalError::ProductionCompleted : If the production is Ended.
JmgExternalTerminalError::NoError : If hours and quantity can be posted on the production
Examples
The following example demonstrates the use of this method.
private JmgExternalTerminalError validateJobStart()
{
JmgTermJob jmgTermJob;
JmgExternalTerminalError ret;
ret = JmgExternalTerminalError::NoError;
// Check the jobId to determine TermRegType.
if (jobId)
{
jmgTermJob = JmgTermJob::construct(jobId);
if (jmgTermJob.sourceData())
{
switch (jmgTermJob.module())
{
case JmgModuleEnum::IPC:
ret = this.validateIpcJobIdStart(jmgTermJob);
break;
case JmgModuleEnum::PROD:
ret = this.validateProdJobIdStart(jmgTermJob);
break;
case JmgModuleEnum::PROJ:
ret = this.validateProjJobIdStart(jmgTermJob);
break;
}
}
else
{
// Unknown job ID.
ret = JmgExternalTerminalError::UnknownJobId;
}
}
else
{
// No job ID.
ret = JmgExternalTerminalError::NoJobIdOnJobStart;
}
return ret;
}