JmgExternalTerminalData.validateProjJobIdStart Method [AX 2012]
Occurs when the registration is a start job on a project job. Part of the validation algorithm.
Syntax
private JmgExternalTerminalError validateProjJobIdStart(JmgTermJob _jmgTermJob)
Run On
Called
Parameters
- _jmgTermJob
Type: JmgTermJob Class
An instance of the JmgTermJob class, which represents the project job.
Return Value
Type: JmgExternalTerminalError Enumeration
The result of the validation.
Remarks
The following error values are returned:
JmgExternalTerminalError::ProjectNotInProgress: If the project is not in stage "In progress".
JmgExternalTerminalError::NoError: If the project is in stage "In progress".
Examples
The following example demonstrates the use of this method.
// From \Classes\JmgExternalTerminalData\validateJobStart
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;
}