ErrorNumber Property
ErrorNumber Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Holds the error number to be reported back to the calling client and logged to the audit trail.
Applies To
Type Library
Microsoft CDO Workflow Objects for Microsoft Exchange
DLL Implemented In
CDOWF.DLL
Syntax
[Visual Basic]Property ErrorNumber As Long
[C++]HRESULT get_ErrorNumber(Long* pVal);
HRESULT put_ErrorNumber(Long Val);
Parameters
- pVal
Returns the value of the ErrorNumber property as a reference to a Long.- Val
Sets the value of the ErrorNumber property to the value of the Long.
Remarks
Upon exiting a script, the workflow engine automatically looks for an error number in this property.
Your script can terminate a transition by passing a negative number (ErrorNumber < 0) back to the workflow engine. The workflow engine logs a failure to the audit trail. Use IWorkflowSession.ErrorDescription to specify an error description to the audit trail.
If you set the ErrorNumber to a non-negative value (ErrorNumber >= 0), the workflow engine ignores it.
Example
If (WorkflowSession.ReceivedMessage.fields("VoteButton").Value = "") Then WorkflowSession.ErrorNumber = &H80004005 'Number returned to client WorkflowSession.ErrorDescription = "Form not completed." SendMail "Please vote" End If
Sub SendMail(MySubject) Set WFMsg = WorkflowSession.GetNewWorkflowMessage() With WFMsg .From = WorkflowSession.Sender .To = WorkflowSession.Sender .Subject = MySubject .TextBody = WorkflowSession.StateFrom & " -> " & WorkflowSession.StateTo .SendWorkflowMessage 0 'cdowfNoTracking End With End Sub
See Also
Send us your feedback about the Microsoft Exchange Server 2003 SDK.
Build: June 2007 (2007.618.1)
© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.