Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > Methods Reference for Siebel VB > COM Methods > Assign COM Object StatementThe Assign COM Object statement assigns a COM object, such as an application, to a variable. In Siebel Tools, you can use it to create an instance of a Siebel object. It does not return a value. The Assign COM Object statement differs from the Let statement. The Let statement assigns an expression to a Siebel VB variable. For example: FormatSet variableName = objectExpression The following table describes the arguments that you can use with this method. Including the Set Keyword When You Assign an Object VariableIf you do not include the Set keyword when you assign an object variable, then Siebel VB attempts to copy the default member of one object to the default member of another object. This situation typically results in the following run-time error:
Example 1The following example uses the Assign COM Object statement:
Example 2The following example creates an Opportunity business component outside the context of the user interface. The code prevents the user from deleting an account if there are opportunities associated with it. For more information about the Siebel VB methods and objects that this example uses, see Siebel Object Interfaces Reference: Function BusComp_PreDeleteRecord As Integer Dim iReturn as integer set oBO = theApplication.GetBusObject("Opportunity") With oBC BusComp_PreDeleteRecord = iReturn |
Siebel VB Language Reference | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |