Learn about Lockerz... watch videos,answer dailies and earn prizes.. Invitations Sent Out: 60 >> << | Next Tip »Home

Forcing Parent Child Relationship

OkAvarageGoodVery GoodExcellent (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

Link Object” lays the foundation of creating a parent child relationship between two entities in Siebel.

If we want to have parent child relationship between two business components here is what we do:

  • Identify a field in child BC that will act as Foreign key in Child BC.
  • Create a link between two Business Components.
  • Define one BC as parent and the other as child
  • Compile the objects

But what if someone comes and says “You need to have parent Child relationship but you cannot use link”. What do you think, Is it possible to do this?

The answer to the above question is, Yes. Two of my friends found a way to force parent child relationship between any two entities without using link.

First of all let me clarify. This can have performance issues so don’t use this solution until and unless it is absolutely required.

Here is what we need to do, but before going ahead I am assuming that I want to have “Opportunity” as Parent BC and “Target”as child BC

  • Goto Opportunity BC > Server Scripts > BusComp_ChangeRecord Event.
  • Write the following Script on Change Record
    TheApplication().SetProfileAttr(“OpptyId”, this.GetFieldValue(“Id”));
  • Goto “Target BC”.
  • Create a Field that will act as foreign key and store Opportunity Id with following details
    Name: OpptyId
    Column: X_OPTY_ID (can by existing column or you can create a new column)
    Pre-Default Value: Expr: “GetProfileAttr(‘OpptyId’)”
  • Goto an Target List Applet (I am assuming “Target List Applet” is based on “Target BC”)
  • In Search Specification enter the following expression:
    ([OpptyId] = GetProfileAttr(“OpptyId”))

That’s it. Now when you will move between Opportunity records it will refresh and only show Target records related to that opportunity.

Note: We had a lot complex implementation and did a lot of other things in addition to this. I am only providing necessary steps to achieve this. In case if you try and it is not working then let me know, I will try to provide solution for your problem.

Related Posts


Article by neel

Authors bio is coming up shortly. neel tagged this post with: Read 416 articles by neel
View Comments Post a Comment
  1. Alex says:

    Why can´t they use a link?

  2. Ayoub says:

    Hi,

    Please stick to the standard, we are all CRM consultants and/or project managers, not developers.

    Thank you for the tip.

  3. Hello Neel ,
    I think “Changing record would be mandatory” otherwise it will not work because you have written code on change record.It will not work for first record immidiate after Applet load.
    Once you ll change the parent applet record , you need to refresh child applet also.other wise it ll show old records.
    Danish

  4. But above is really a good article to help and understand other ways in siebel customization.

  5. TJ says:

    Hi,
    I think most of you will agree that there is lot of confusion on BusComp and Applet script events. Specially about the sequence of their execution. I think these are not completely documented any where.
    Sometimes there are many class based method execute on BCs and applets for instance “Expand” method is executed on query of Order line item BC.

    Is there way to know about methods and events executed on any object by using any log or server setting?

  6. Niraja says:

    Hey Neel,
    I have a similar situtaion where i cannot create link and have to force parent child relationship. Above solution works only when child Applet Loads everytime Parent Change Record event fires.

    In my case Parent and Child is showed as list applet in the same view. When change record in Parent fires and profile value is set child record data is restricted based on the profile when applet loads for the first time. Subsequent change record and profile change does not change child record value. Plz let me know if you have any suggestion

blog comments powered by Disqus

Polls

Do you know how to use replace function?

View Results

Loading ... Loading ...