JmgExternalTerminalData.validateProdJobIdStop Method [AX 2012]
Occurs when the registration is a stop job on a production job. Part of the validation algorithm.
Syntax
private JmgExternalTerminalError validateProdJobIdStop(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.
// From \Classes\JmgExternalTerminalData\validateJobStop
private JmgExternalTerminalError validateJobStop()
{
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.validateIpcJobIdStop(jmgTermJob);
break;
case JmgModuleEnum::PROD:
ret = this.validateProdJobIdStop(jmgTermJob);
break;
case JmgModuleEnum::PROJ:
ret = this.validateProjJobIdStop(jmgTermJob);
break;
}
}
else
{
// Unknown job ID.
ret = JmgExternalTerminalError::UnknownJobId;
}
}
else
{
// No job ID.
ret = JmgExternalTerminalError::NoJobIdOnJobStop;
}
return ret;
}