Few days ago a user on siebelunleashed forum asked me a question. It appeared to be a simple question to be me but can be difficult to answer by a newbie in Siebel. So, I thought I would answer it in complete detail through a post. The question was related to below given requirement.

Requirement:

When a new record for Opportunity is created then an Activity needs to be created which should have certain details of the newly created opportunity and the activity should also be related to this opportunity.

User had also posted the code which he had written to achieve this requirement. The problem he faced was that the opportunity created with this code as was not related to the opportunity. So, somebody helped him to modify the code and include an additional statement which was:

bc.SetFieldValue(”Oppty Id”,OptyId );

This helped in establishing the relationship of this activity with the newly created opportunity.

The question or doubt which he had was:

“How do u determine which field values you have to use? e.g. here we have used OptyId - how do we determine this?”

The answer to the above question is:

In Siebel parent/child relationships are created with the help of link. In link definition we provide Source BC, Destination BC, Source Field and Destination Field.

The Field which is mentioned in Destination Field stores the Row Id of parent record and link uses this field to pull up all the child records for a particular parent. So whenever you need to create parent/child relationship through scripting you will need to populate this field with appropriate Id.

To determine which field to use in such cases here are the steps you need to follow

  • Go To the Business Object in Tools
  • Query for the BO that you will use.
  • In BO query for the Child BC (Action in the above example)
  • Click on the link specified in the Link Field (it will take you the link object)
  • Copy the value in the Destination Field that is the field that you need to use in your scripting.

This Field should always contain the Row Id of parent record otherwise it will be Standalone or an Orphan record.

OkAvarageGoodVery GoodExcellent (6 votes, average: 3.67 out of 5)
Loading ... Loading ...