Configuring Drilldown on a Form Applet

  • Upload
    mdwaris

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

  • 7/31/2019 Configuring Drilldown on a Form Applet

    1/2

    Configuring drilldown on a Form Applet

    I bet many you would immediately think it is not possible to configure a drill down on a form

    applet but I would say, Technically it is possible. It wouldnt be usual Hyperlink on a field

    that we have on a list applet but it would work the same way.

    First lets analyze thefunctionality of usual drilldown that we have on a list applet. You

    configure a field to have a drilldown. In UI that field value starts acting as Hyperlink and

    clicking on that Hyperlink takes you to another view and important thing to note is that it

    maintains the context and you land up on the same record on which you drilldown.

    Now, in form applet is not possible to configure the field value to appear as Hyperlink but it is

    possible to have a button which will act in same way.

    How is it possible?

    There is a function provided by Siebel GotoView that can help us to achieve this functionality.

    GotoView elaborated!

    GotoView function accepts two arguments View Name and Business Object Instance for

    example

    GotoView(Opportunity Detail View,OptyBO)

    The second argument (BO Instance) is optional but ifyou dont provide that you will not be

    able to maintain the context which means that you will not land up on the same record. BO

    Instance which is passed should be an inactive BO instance you cannot use ActiveBusObject

    function to get BO Instance.

    Lets see this functionality in action with help of a requirement

    Requirement:

    I have Opportunity (Parent) and Quotes (Child). I want to have a button on Opportunity Form

    Applet with caption (My Primary Quote) on click of the button user should be taken to Quotes

    View and Quote which has Primary Flag set to true should be visible.

    Primary Flag is just a boolean base field.

    Solution:

    I am assuming that you have already exposed a button with MethodName as

    ShowPrimaryQuote. I am just going to provide the code.

    if(MethodName == ShowPrimaryQuote)

    {

  • 7/31/2019 Configuring Drilldown on a Form Applet

    2/2

    var QuoteBO:BusObject = TheApplication().GetBusObject(Quote);

    var QuoteBC:BusComp = QuoteBO.GetBusComp(Quote);

    with(QuoteBC)

    {

    SetViewMode(AllView);

    ClearToQuery();

    ActivateField(OpptyId); // Field that stores Opportunity Id

    ActivateField(PrimaryFlag);

    SetSearchSpec(OpptyId,this.GetFieldValue(Id));

    SetSearchSpec(PrimaryFlag,Y);

    ExecuteQuery(ForwardOnly);

    if(FirstRecord())

    {

    GotoView(Quote Detail View,QuoteBO);

    }

    }

    }

    This code will take the user to Quote detail view if it is able to find Primary Quote for that

    opportunity otherwise it will do nothing. You can modify it to give an error message or some

    other processing if required.