Mastering PowerBuilder

HomePrevious Lesson: Connecting to Jaguar CTS from PowerBuilder Application
Next Lesson: Retrieving Data via Jaguar CTS Component

Instantiating Jaguar CTS Components

Declare an instance variable in w_product_master as shown below:
product_master incst_product_master

Please note that, the object name in the declaration is product_master, not n_product_master. This is because, in the Jaguar Component Wizard, we choose product_master name for the component in Jaguar. If you choose the same name as n_product_master, then you can declare that variable type and move that object to another library at run-time.
Object: w_product_master
Event: Open
IF g_JaguarConnection.CreateInstance(incst_product_master) <> 0 THEN
   MessageBox("Jaguar", "Cannot create instance")
   Return
END IF

In the w_product_master Open event, we are creating an instance of the product_master by calling CreateInstance() function. Please note that this function is declared at the Connection object. Same function with a little different format is available at the TransactionServer object that is used within the Jaguar component�for example, product_master in this case�and can connect to another Jaguar server and instantiate another object on a remote server. The remote server is not necessarily be hosted on the same machine/operating system.
HomePrevious Lesson: Connecting to Jaguar CTS from PowerBuilder Application
Next Lesson: Retrieving Data via Jaguar CTS Component