GetMultipleFieldValues Method

The GetMultipleFieldValues method returns a value for each field that a property set specifies. It uses the following syntax:

BusComp.GetMultipleFieldValues(fieldNamesPropSet, fieldValuesPropSet)

where:

  • fieldNamesPropSet is a property set that identifies a collection of fields.

  • fieldValuesPropSet is a property set that includes values for the fields that the fieldNamesPropSet argument specifies.

If an error occurs, then GetMultipleFieldValues returns err with an error message. For example:

{err: "Error Message",retVal: ""}

If an error does not occur, then GetMultipleFieldValues returns an empty err message. For example:

{err: "",retVal: ""}

You cannot use the same instance of a property set for the fieldNamesPropSet argument and for the fieldValuesPropSet argument.

Example of Using the GetMultipleFieldValues Method

The following example uses the GetMultipleFieldValues method:

var oPsDR_Header = SiebelApp.S_App.NewPropertySet();
// Cannot use the same property set in GetMultipleFieldValues, must use a
// different one for the values. The process will not error, but Siebel Open UI    
// will not place  the values in the property set.
var lPS_values = SiebelApp.S_App.NewPropertySet();
oPsDR_Header.SetProperty("Last Name","");
oPsDR_Header.SetProperty("First Name","");
oPsDR_Header.SetProperty("Middle Name","");
var currRetValue={err:false}, retObj;
var model= SiebelApp.S_App.GetModel();
var boContact = model.GetBusObject("Contact");
var bcContact = boContact.GetBusComp("Contact");
bcContact.ActivateMultipleFields(oPsDR_Header);
bcContact.SetSearchSpec("Last Name", "Mead*");
currRetValue=ExecuteQuery();
currRetValue=FirstRecord();
// Use a different property set for the values. If you use the same one
// for arguments you get no values back.
currRetValue=GetMultipleFieldValues(oPsDR_Header, lPS_values);
// Get the value from the output property set.
SiebelJS.Log("FullName is " +lPS_values.GetProperty("First Name") + 
lPS_values.GetProperty("Middle Name")+ lPS_values.GetProperty("Last Name"));