Sei sulla pagina 1di 6

All about MVL

What is Multi-Value Link? A multi-value link is used in the implementation of a multi-value group. A multi-value group is a user-maintainable list of detail records associated with a master record. The user invokes the list of detail records from the master record when it is displayed in a list or form applet. For example, in an applet displaying the Account business component, the user can click the Select button to the right of the Address text box to see a pop-up window displaying multiple Address records associated with the currently displayed account. The multi-value link object definition performs two roles: To give fields in the master business component access to primary record field Values through the link. To allow embedding of detail data in the same business component as master Data, so both can appear in the same applet. How do u define the Multivalue Link ? Multi-value link. The multi-value link provides access to the set of records in the detail business component. One multi-value link is created for each multi-value group that is created using the one-to-many extension table. What is an Indirect Multi value Link? If there is a join object definition that joins a master business component to the master business component of the link, the existing link can be used in a multivalue link. In essence, the multivalue link is being based on a join to a link. Such a multi-value link is known as an indirect multi-value link. The primary difference between the Business Address multi-value link in the Contact business component and in its Account counterpart is that the multi-value link object definition is found in a business component other than the master business component. The Source Field property in the multi-value link in the Contact business component is nonblank. In a conventional multi-value link this property is blank, indicating that the Id field in the current business component is used (corresponding to ROW_ID in the base table). In the indirect multi-value link, the Source Field property specifies a field in the S_ORG_EXT join called Joined Account ID. The Joined Account ID field provides the Account Id of the Account that Corresponds to the current Contact. What are MVF? The fields in the master business component (Account in the illustration) that are populated by the primary record in the multi-value group business component are called multi-value fields.

Multi-value fields are populated with data from a record in the detail business component because of the multi-value link. Multi Value Link is a child object type of Business Component that defines a master-detail relationship (based on a link) to embed in the business component. Multi-value fields are those fields that have a non-blank Multi Value Link property and a Multi Valued property value of TRUE; all other fields are single-value fields. What is the purpose of MultiValue Field? Multi Value Field displays the child records of a parent record. When the button of a multi-value field is clicked, Siebel applications will display all the child records of the parent record. The data displayed in a multi-value field is that of the actively selected parent record. The multi-value field provides access to a corresponding field value in the current record of the detail business component. The control or list column that displays the multi-value field normally will be able to invoke a multi-value group applet for display and maintenance of the detail records.

How would you make an MVF required? By using Siebel scripting. If there is a Primary Id specified by making that field required. How can a MVF be configured to be a required field? Ref: [http://siebeltalk.blogspot.com/2008/07/how-can-mvfbe-configured-to-be.html]
Currently, the standard Siebel application does not provide the ability to make a multi value field required. The solution currently available right now is to write Visual Basic (VB) code to enforce the business requirement. The Sample VB code to make the Street Address Multi Value Field to be a required field would be: Function BusComp_PreWriteRecord As Integer DIM streetAddress AS String streetAddress = Me.ActivateField(Street Address) streetAddress = Me.getFieldValue(Street Address) If NOT len(streetAddress) > 0 then MsgBox Please Enter Street Address BusComp_PreWriteRecord = CancelOperation exit Function end if BusComp_PreWriteRecord = ContinueOperation End Function

Is there a need of making the MVG field read only? So that invalid data can not be entered and always the MVG applet is invoked to pick the record. How would you make an MVG applet read only? By checking the No Update property in MVG Field. If the base record is read only and we need to make the MVG applet read only, one has to use BC user property Parent Read Only Field in the MVG BC. How do I update the Last Updated date when associating a record in MVG? If you associate a new record in MVG field (i.e. if associating an account to a contact) the last updated field is not updated for the contact. Hence, it is difficult to know who is associated with the account. The updated field is only changed if the Primary account is changed. The solution is simple. Just write a server script in event WebApplet_InvokeMethod in the applet, which is invoked. In this case, it is Account Mvg Applet. What is the difference between Link and Multi-value Link? Multivalue link is a child object at Business Component level. This is an instance of the Link. Links are used to link data in two business components which occupies different applets of the view, whereas Mulitvalue links are used to display multivalue fields in the parent business component. How would you create a Reverse Join and an Indirect Link? Indirect Link: The parent business component of a multi-value link (MVL) is usually the same as the business component in which the MVL is defined. However, by using the Source Field property of the [Multi Value Link] object, it is also possible to create an MVL whose parent business component is related to the current business component indirectly via a join or via another MVL. Reverse Join: The Source Field in the join spec holds the foreign key where the Destination Column provides the primary key. The pickmaps on the joined field provide the mapping between these when a value from the pick BC is picked from the pick applet. As a result, the primary key value (specified in Destination Column) is copied into the column on which the source field is based on. However, if the join spec is reversed, i.e. the Source Field is set to Id, the join reverses the relationship and the pick BC no more provides the primary key value. In such situations, if a picklist and pick applet is implemented on the joined fields, the users update the primary key in the base BC (that implements join) which is Row_Id. Essentially, the Row_Id of current record is modified in this case. What is primary ID Field? Primary id field is the property of link Object.

The name of a parent business components field that will contain the ID of the child business component record selected as the primary.Which is based on Primary Forien key in the parent table. Whats the significance of Primary ID and how do u set one? The Link and Multi Value Link object definitions have a set of properties that you can use to specify to the system how to obtain the record ID of the first record to display of the detail table each time the master record changes. These properties are Primary Id Field, Use Primary Join, and Auto Primary. Together they implement the primary ID field. The basic concept behind a primary ID is that it is faster for a Siebel application to retrieve one primary record from the MVG business component through a join than retrieve all of them through a sub-query especially since users can see values from only one child record until they open up the MVG applet. To create a primary field for a one-to-many or many-to-many relationship, complete the following procedure. To configure a primary field for a 1: M or M: M relationship 1 Create a Primary Id column. 2 Create a field based on that Primary Id column. 3 In a Multi-Value Link, set the Primary Id Field attribute to the new Primary Id field. 4 Set the Use Primary Join attribute to TRUE. The benefit of using a primary ID, from the systems standpoint, is that it converts a one-to-many relationship into a one-to-one relationship. This allows the row Retrieval process to be simplified from a query with subqueries to a simple join Query. This substantially improves performance, especially when the user is Scrolling through the records of a list applet that displays the master.

Multivalue Link and Primary Id Field


A user asked me a question about Primary Id Field property in the Multivalue Link in a Business Component. Below is the question she actually asked: I dont understand the use of the Primary ID field in the MVL Link. As I understand it, it uniquely identifies the primary child record. Since that is only the primary child, what about the rest of the children? How are they identified? I read time and time again, that providing the primary id, means that the number of queries to populate the list applet(containing MVGs) is reduced to 1 and so on. I dont understand how the primary id field facilitates this. Could you please explain? From her questions I can derive at least following points:

Primary Id Field is optional but recommended to be used.

It helps in saving queries at database level. It identifies the Primary Child.

Now we need to figure out how Primary Id Fields helps us in doing the above things. I will try to explain the answer in as simple language as I can. A typical setup of M-M relationships in Siebel is shown as below:

A Field exposed on Form applet displaying the primary record and when you click on the little icon you get to see the complete set of records. Above picture is showing Account Team record where you can just view the Primary Record (SADMIN) of the Account team. This setup is what makes Primary Id Field Important. As it is clear from the screenshot that even if the Account team has 50 members their information is not needed till the time user specifically clicks on MGV icon on that field and invokes the Shuttle applet. Whenever you assign a record as Primary (by clicking Primary Flag to true) Siebel stores the row id of that particular record in the field mentioned Primary Id Field property of MVL.

In the above example Row Id of the position that is assigned as Primary on Account team will be stored in Primary Position Id field in Account BC. When a particular account records is displayed on applet, Siebel uses that field value in a Join Condition to pull the primary record information, thus executing only one query to bring Parent and Child entity value. Only when you open shuttle applet, Siebel executes the query to pull information for rest of records. Just imagine exposing a MVL field in a list applet instead of form applet with Primary ID Field property as blank. When ever the applet is going to be loaded Siebel is going to execute one extra query per account record displayed on list applet, to fetch all the child record information even though it is not needed. Simply speaking if 10 account records are displayed on list applet then

With Primary ID Field filled Siebel will execute 10 queries (primary record information is pulled through join) With Primary ID Field as blank Siebel will execute 10 extra queries (1 for the related child records of each account even though they are not needed)

This is the reason providing value in Primary Id Field is highly recommended as it avoids execution of queries that will be bring information that is redundant and cannot be viewed by the user. To understand it better I would recommend starting your dedicated client with spool on and then go through the queries generated by Siebel with Primary ID Field as blank and nwith a value.

Potrebbero piacerti anche