Share via


JmgExternalTerminalData.validateJobStart Method [AX 2012]

Part of the validation algorithm. When it is determined, that a start job registration has been received from the external terminal, this method is called.

Syntax

private JmgExternalTerminalError validateJobStart()

Run On

Called

Return Value

Type: JmgExternalTerminalError Enumeration
The result of the validation.

Remarks

The following error values are returned:

  • JmgExternalTerminalError::NoJobIdOnJobStart: If the job ID field is empty.

  • JmgExternalTerminalError::UnknownJobId: If the job ID field contains an unknown job ID.

If none of these two error conditions are met, then depending on the job type, the result of invoking one of the methods validateIpcJobIdStart, validateProdJobIdStart, or validateProjJobIdStart is returned.

Examples

The following example demonstrates the use of this method.

// From \Classes\JmgExternalTerminalData\validate 
  
public void validate() 
{ 
    ; 
    try 
    { 
        error = this.validateMandatoryFields(); 
 
        if (error != JmgExternalTerminalError::NoError) 
        { 
            return; 
        } 
 
        switch (externalRegType) 
        { 
            case JmgExternalTerminalRegType::ClockIn: 
                error = this.validateClockIn(); 
                break; 
            case JmgExternalTerminalRegType::ClockOut: 
                error = this.validateClockOut(); 
                break; 
            case JmgExternalTerminalRegType::JobStart: 
                error = this.validateJobStart(); 
                break; 
            case JmgExternalTerminalRegType::JobStop: 
                error = this.validateJobStop(); 
                break; 
            default: 
                error = JmgExternalTerminalError::IllegalExternalTermRegType; 
                break; 
        } 
    } 
    catch (Exception::Error) 
    { 
        error = JmgExternalTerminalError::UnexpectedError; 
    } 
} 

See Also

JmgExternalTerminalData Class

JmgExternalTerminalData.validate Method