Imaginemos que cuando creamos nuevos registros en las oportunidades, queremos que el nombre de la misma sea compuesto por:
Contador + Id de la oportunidad + product description
El contador como se quiere genérico para las oportunidades se utiliza una lista de valores.
Lista de valores:
Type: OPTY_SEQUENCE
Display Value: 1
LIC: 1
Para que se incremente el valor en la LOV en 1, creamos un workflow que se ejecutará después que se creé el nuevo registro de la oportunidad.
El workflow tendrá los siguientes pasos:
Siebel Operation «Query List of Values»
Siebel Operation «Update»
Siebel Operation «Query List of Values»

Properties:
BC: List Of Values;
Operation: Query;
Search Spec Input Arguments
Expression BC: List Of Values
Sequence: 1
Filter BC: List Of Values
Type: Literal
Search Specification: Aquí sera el Type igual al nombre de la LOV_TYPE, en este caso OPTY_SEQUENCE
Output Arguments:
Output Argument 1
Property Name: LOV ID
Sequence: 2
Type: Business Component
BC Name: List Of Values
BC Field: Id
Output Argument 2
Property Name: Oppty Count
Sequence: 3
Type: Business Component
BC Name: List Of Values
BC Field: Value
Siebel Operation «Update»
Properties:
BC: List Of Values
Operation: Update
Field Input Arguments:
Field Name: Value
Type: Expression
Value: [&Oppty Count]+1
Search Spec Input Argument:
Expression BC: List Of Values
Sequence: 1
Filter BC: List Of Values
Type: Literal
Search specification: El Id sera igual al LOV ID del paso anterior
Para finalizar, hay que ir al evento WriteRecord del BC Opportunity y decir la condición en que el workflow se ejecuta.
function BusComp_WriteRecord()
{
var oActiveBO = TheApplication().ActiveBusObject().Name();
var svc = TheApplication().GetService(«Workflow Process Manager»);
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
if(oActiveBO == «Opportunity») {
Input.SetProperty(«ProcessName»,»EJ Oppty Count WF»);
svc.InvokeMethod(«RunProcess», Input, Output);
this.InvokeMethod(«ClearLOVCache»);
}
}









