Configuring Siebel eBusiness Applications > Configuring Business Components > About Calculated Fields >

Creating Sequence Fields


Situations can occur in which you need to create a field that provides sequential numbering for the parent business component. For example, you may need to number line items in an Order or products in an Opportunity. Sequential numbering is not automatically provided in any system columns in standard tables in Siebel applications. However, you can configure a sequence field in a detail business component by adding a business component user property called Sequence Field and creating a sequence business component with a special business component class called CSSSequence.

The details of configuration of a sequence field appear in Figure 35.

Figure 35.  Sequence Field Configuration Details
Click for full size image

The roles of the object definitions in Figure 35 are as follows:

  • Master business component. In the master-detail relationship in which the detail records are to be numbered, this is the business component that holds master records. For example, the Opportunity business component is the master in the master-detail relationship with Opportunity Product.
  • Numbered detail business component. In the master-detail relationship, this is the business component that holds detail records. For example, the Opportunity Product business component is the detail in the master-detail relationship with Opportunity. The numbered detail business component has the following important child object definitions:
    • Line Number field. This field, named Line Number, is a field of type DTYPE_NUMBER that holds the resulting sequence value.
    • Business component user. A business component user property object definition named Sequence Field needs to be present, with the Value property set to "Line Number."
  • Sequence business component. This business component is named xx.Line Number (Sequence), where xx is the name of the numbered detail business component. It has a specialized class of CSSSequence, and the following two fields:
    • Sequence field. This field, named Sequence, is of type DTYPE_NUMBER.
    • Foreign key field. This field is a foreign key field based on a foreign key column in the detail table. The foreign key column points to the primary key of the base table of the master business component, and may be used to specify the link between the master and sequence business components.
  • Detail table. The detail table is the base table for both the numbered detail and sequence business components.
  • Links. One link provides the master-detail relationship between the master and numbered detail business components. The other link provides the master-detail relationship between the master and sequence business components. The link to the numbered detail business component is usually preexisting, such as Opportunity or Opportunity Product. The link to the sequence business component is usually added by the developer, except when the sequence configuration is included in standard Siebel applications. Opportunity or Opportunity Product.Line Number (Sequence) is an example of a link to a sequence business component.
  • Business Object. The second link is included in the same business object that holds the first link.

Examples of sequence field configuration in standard Siebel applications can be viewed in Siebel Tools. For example, examine the Opportunity Product and Opportunity Product.Line Number (Sequence) business components, which are the numbered detail and sequence business components, respectively.

To add a sequence field to a business component that does not currently have one

  1. Verify that the class of the detail business component is CSSBCBase or a sub-class of CSSBCBase.

    If it is not, contact Siebel Technical Services for assistance with this procedure.

  2. Verify that the business component to which you want to add a sequence field is the detail business component in a master-detail relationship. This is the numbered detail business component.

    NOTE:  The numbering of detail records will start from 1 within each master record.

  3. Add a child field object definition to the numbered detail business component. Set the Name property value to Line Number, the Type to DTYPE_NUMBER and the column to a numeric extension column such as ATTRIB_14.
  4. Add a child business component user prop object definition to the numbered detail business component. Set the Name property value to Sequence Field, and the Value property to Line Number.
  5. Create a business component. Set the Class property to CSSSequence, the table to the name of the base table of the numbered detail business component, and the Name to xx.Line Number (Sequence), where xx is the name of the numbered detail business component. This is the sequence business component.
  6. Set the Sort Spec of the xx.Line Number (Sequence) business component to Sequence (DESCENDING).
  7. Add a child field object definition to the sequence business component. Specify a Name property value of Sequence, and a column value the same as the extension column specified for the Line Number field in the numbered detail business component.
  8. Add a child field object definition to the sequence business component. This is the foreign key field that establishes the master-detail relationship to the master business component. The Column property should be set to the same column as the corresponding field in the numbered detail business component.
  9. Create a link object definition that establishes a master-detail relationship between the master and sequence business components.
  10. Create a Business Object Component child object definition of the business object or business objects that use the existing link between the master and numbered detail business components. Specify the new link and the sequence business component in the Link and Business Component properties, respectively.
  11. Expose the Line Number field in applets that display records from the numbered detail business component.
Configuring Siebel eBusiness Applications