Invoke
Use Invoke to call IDO methods, not including the custom load methods. Invoke requests are constructed using the InvokeRequestData IDO protocol class.
Properties
These properties are available on the InvokeRequestData class:
Property | Data Type | Description |
---|---|---|
IDOName | System.String | Identifies the IDO used to execute the request |
MethodName | System.String | Identifies the IDO method to be executed |
Parameters | Mongoose.IDO.Protocol.InvokeParameterList | Specifies a collection that contains instances of the InvokeParameter class corresponding to the IDO method parameters |
Invoke example 1
To execute an Invoke request, first construct an instance of the InvokeRequestData class, and pass it to the Invoke method on the IIDOCommands interface.
InvokeRequestData request = new InvokeRequestData(); InvokeResponseData response; request.IDOName = "UserNames"; request.MethodName = "UserValidSp"; request.Parameters.Add( "ajones" ); // user name, input request.Parameters.Add( IDONull.Value ); // user ID, output request.Parameters.Add( IDONull.Value ); // description, output request.Parameters.Add( IDONull.Value ); // infobar, output response = this.Context.Commands.Invoke( request ); if ( response.IsReturnValueStdError() ) { // get infobar output parameter string errorMsg = null; errorMsg = response.Parameters[3].Value; } else { int userID = 0; string desc = null; userID = response.Parameters[1].GetValue<int>(); if ( !response.Parameters[2].IsNull ) { desc = response.Parameters[2].Value; } }
Invoke example 2
In many cases it is more convenient to call the overloaded version of the Invoke method that accepts parameters for the IDOName, MethodName, and method parameters InvokeRequestData properties.
InvokeResponseData response; response = this.Context.Commands.Invoke( "UserNames", "UserValid", "ajones", IDONull.Value, IDONull.Value, IDONull.Value ); if ( response.IsReturnValueStdError() ) { // get infobar output parameter string errorMsg = ""; errorMsg = response.Parameters[3].Value; } else { int userID = 0; string desc; userID = response.Parameters[1].GetValue<int>(); if ( !response.Parameters[2].IsNull ) { desc = response.Parameters[2].Value; } }