Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >
SetFormattedFieldValue
SetFormattedFieldValue assigns the new value to the named field for the current row of the business component. SetFormattedFieldValue accepts the field value in the current local format.
Syntax
oBusComp.SetFormattedFieldValue FieldName, FieldValue
Argument Description FieldName String containing the name of the field to assign the value to. FieldValue String containing the value to assign.Returns
Not applicable
Usage
This method is useful when you write code for a Siebel configuration that is used in multiple countries with different currency, date, and number formats. This method can be used only on fields that have been activated using ActivateField.
Used With
Browser Script, Server Script, Mobile/Dedicated Web Client Automation Server, COM Data Control, COM Data Server, Java Data Bean, CORBA Object Manager
Example
This Siebel VB example is a fragment from a program designed to track the velocity of an opportunity through its sales stages.
(general) (declarations)
Option ExplicitDim OpportunityBO as BusObject, StageBC as BusComp
Dim OppStageId as String, SalesRep as String, Stage as String
Dim StagePrev As String, StageDate as String, StageDatePrev as String
Dim Dx as Double, Dy as Double, Diff as Double, DiffStr as String
Dim OppID As String, OppStageId as String, StageID As String
Dim SalesStageBO as BusObject, SalesStageBC as BusCompSet SalesStageBO = TheApplication.GetBusObject ("Sales Cycle Def")
Set SalesStageBC = SalesStageBO.GetBusComp("Sales Cycle Def")With SalesStageBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Sales Cycle Stage", StagePrev
.ExecuteQuery ForwardOnly
.FirstRecord
StageId = .GetFieldValue("Id")
End With'Instantiate stage BC
Set StageBC = OpportunityBO.GetBusComp("Opportunity Stage")'Check that we do not already have a record for the stage
With StageBC
.SetViewMode AllView
.ClearToQuery
.SetSearchSpec "Sales Stage Id", StageId
.ExecuteQuery ForwardOnly
'Proceed further only if we do not already have record
'opportunity sales stageIf (.FirstRecord = 0) Then
'Create a new stage record and write it out
.NewRecord 1
'Record Id for future use
OppStageId = .GetFieldValue("Id")
.SetFieldValue "Opportunity Id", OppId
.SetFieldValue "Sales Stage Id", StageId
.SetFieldValue "Sales Rep", SalesRep
.SetFormattedFieldValue "Entered Date", StageDatePrev
.SetFormattedFieldValue "Left Date", StageDate
Dx = DateValue (StageDatePrev)
Dy = DateValue (StageDate)
Diff = Dy - Dx
DiffStr = Str(Diff)
.SetFieldValue "Days In Stage", DiffStr
.WriteRecord
End If
End WithSee Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference Published: 18 June 2003 |