Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
With Statement
This standard VB construct executes a series of statements on a specified variable.
Syntax
With variable
statement_block
End With
Placeholder Meaning variable The variable to be changed by the statements in statement_block statement_block The statements to execute on the variableReturns
Not applicable
Usage
Variable can be an object or a user defined type. The With statements can be nested.
Example
This example uses a Siebel VB method to change values in an object when a specific field is successfully changed. With is used to refer to the object in which the values are changed. For another example, read Nothing Function.
Sub BusComp_SetFieldValue(FieldName As String)
Select Case FieldName
Case "Account Status"
If Me.GetFieldValue(FieldName) = "Inactive" Then
Dim oBCact as BusComp
Dim sMessage as String
Set oBCact = me.BusObject.GetBusComp("Action")
sMessage = "ADDED THRU SVB: Account Status made Inactive"With oBCact
.NewRecord NewAfter
.SetFieldValue "Type", "Event"
.SetFieldValue "Description", sMessage
.SetFieldValue "Done", _
Format(Now(),"mm/dd/yyyy hh:mm:ss")
.SetFieldValue "Status", "Done"
.WriteRecord
End Withset oBCact = Nothing
End If
End SelectEnd Sub
See Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |