Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

SetFormattedFieldValue Method

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.


Not applicable


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, 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:

Function BusComp_PreWriteRecord As Integer

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 OpportunityBO = TheApplication.GetBusObject ("Opportunity")
Set SalesStageBO = TheApplication.GetBusObject ("Sales Cycle Def")
Set SalesStageBC = SalesStageBO.GetBusComp("Sales Cycle Def")

With SalesStageBC
   .SetViewMode AllView
   .SetSearchSpec "Sales Cycle Stage", StagePrev
   .ExecuteQuery ForwardOnly
   If (.FirstRecord) Then
      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
      .SetSearchSpec "Sales Stage Id", StageId
      .ExecuteQuery ForwardOnly

'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
            .NewRecord NewAfter
            '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
      End If
   End With

Set SalesStageBC = Nothing
Set SalesStageBO = Nothing
Set StageBC = Nothing
Set OpportunityBO = Nothing

End Function

Related Topics

ActivateField Method
SetFieldValue Method

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.