Delete Objects You Have Created That You No Longer Require

Although the interpreter performs object cleanup, it is recommend that you write code that explicitly deletes objects it created that you no longer require. Your code must delete each Siebel object in the same procedure it used to create it.

To delete objects, do the following:

  • In Siebel VB, set each object to Nothing.

  • In Siebel eScript, set each object to Null.

You can delete these objects in the reverse order that the code created them. Make sure you code deletes child objects before it deletes parent objects.

Example of Deleting Objects in Siebel VB

The following code is an example of deleting objects in Siebel VB:

Set oBusObj = TheApplication.GetBusObject("Contact")
Set oBusComp= oBusObj.GetBusComp("Contact")

Your code here

Set oBusComp = Nothing
Set oBusObj = Nothing

Example of Deleting Objects in Siebel eScript

The following code is an example of deleting objects in Siebel eScript:

var oBusObject = TheApplication().GetBusObject("Contact"");
var oBusComp = oBusObject.GetBusComp("Contact");

Your code here

oBusComp = null;
oBusObject = null;