GetPicklistBusComp Method for a Business Component

The GetPicklistBusComp method returns the name of the pick business component that is associated with a field in the current business component. If there is no picklist associated with this field, then this method returns an error.

Format

BusComp.GetPicklistBusComp(FieldName)

The arguments you can use in this format are the same as the arguments that are described in ActivateField Method for a Business Component, except that the GetPicklistBusComp method uses the FieldName argument to identify the pick business component.

Usage

To manipulate a picklist, you can use the name of the pick business component that the GetPicklistBusComp method returns.

After you run the GetPicklistBusComp method, it is recommended that you set the pick business component to one of the following:

  • Nothing in Siebel VB

  • Null in Siebel eScript

Picking a Record on a Constrained Picklist

If Siebel CRM uses the GetPicklistBusComp method or the Pick method to pick a record on a constrained picklist, then the constraint is active. The pick business component that these methods return contains only those records that fulfill the constraint.

To Pick a Value From a Picklist in Siebel VB

You can pick a value from a picklist in Siebel VB.

To pick a value from a picklist in Siebel VB

  1. Use the GetPicklistBusComp method to create an instance of the picklist business component.

  2. Navigate in the pick business component to the record you must pick.

  3. Use Pick to pick the value.

  4. To explicitly delete this instance of the pick business component, use the following code:

    Set objBCPickList = Nothing.
    

Used With

COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script

Examples

The following example is in Siebel eScript:

if (this.GetFieldValue("City") == "San Mateo")
{
   var oBCPick = this.GetPicklistBusComp("State");
   with (oBCPick)
   {
      ClearToQuery();
      SetSearchSpec("Value", "CA");
      ExecuteQuery(ForwardOnly);
      if (FirstRecord())
         Pick();
   }
   oBCPick = null;
}

The following example is for Siebel Java Data Bean. It chooses a product from a picklist:

Sieb_busObject = Sieb_dataBean.getBusObject("Service Request");
Sieb_busComp = Sieb_busObject.getBusComp("Service Request");
Sieb_busComp.newRecord(false);

.  .  .

SiebelBusComp productBusComp = Sieb_busComp.getPicklistBusComp("Product");
productBusComp.clearToQuery();
productBusComp.setSearchSpec("Name", "ATM Card");
productBusComp.executeQuery(false);
isRecord =productBusComp.firstRecord();
try
{
   if (isRecord)
   productBusComp.pick();
   Sieb_busComp.writeRecord();
}

catch (SiebelException e)
{
   System.out.println("Error in Pick " + e.getErrorMessage());

}

The following example is in Siebel VB:

If Me.GetFieldValue("City") = "San Mateo" Then
   Set oBCPick = Me.GetPicklistBusComp("State")
   With oBCPick
      .ClearToQuery
      .SetSearchSpec "Value", "CA"
      .ExecuteQuery ForwardOnly
      If .FirstRecord Then .Pick
   End With
   Set oBCPick = Nothing
End If

Related Topics

For more information, see the following topics: