Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >
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.
BusComp.SetFormattedFieldValue FieldName, FieldValue
String containing the name of the field to assign the value to.
String containing the value to assign.
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.
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script
This Siebel VB example is a fragment from a program designed to track the velocity of an opportunity through its sales stages.
Dim 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 BusComp
Set SalesStageBO = TheApplication.GetBusObject ("Sales Cycle Def")
Set SalesStageBC = SalesStageBO.GetBusComp("Sales Cycle Def")
.SetSearchSpec "Sales Cycle Stage", StagePrev
StageId = .GetFieldValue("Id")
'Instantiate stage BC
Set StageBC = OpportunityBO.GetBusComp("Opportunity Stage")
'Check that we do not already have a record for the stage
.SetSearchSpec "Sales Stage Id", StageId
'Proceed further only if we do not already have record
'opportunity sales stage
If (.FirstRecord = 0) Then
'Create a new stage record and write it out
'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