Search here for wide range of results..
Loading
Home » Configuration, Scripting

How to show Primary Record of MVG on Parent Applet when MVG Closes?

6 May 2009 2 Comments

Scenario:

When you select any record in a MVG applet, and then close the applet with that record selected, that record is shown on the MVF of parent. Now our requirement is that we want to show only the Primary Record of the MVG to show up in Parent MVF, how to achieve it –

Solution:

Write the below code in the MVG Applet’s Server Script – WebApplet_PreInvokeMethod

function WebApplet_PreInvokeMethod (MethodName)
{
   if (MethodName == "CloseApplet")
   {
       this.BusComp().ClearToQuery();
       this.BusComp().SetSearchSpec("SSA Primary Field","Y");
       this.BusComp().ExecuteQuery(ForwardOnly);
   }
     return (ContinueOperation);
}
 

Hence, when the MVG applet is closed, CloseApplet Method is fired. If the event is MVG Applet Close, then IF condition satisfies and we are run a query with search spec as Primary Field = TRUE(Y). This will return and show only Primary Record on applet closure on parent applet’s MVF.

Post your replies below and any question to Interview Forum.

Read some more similar posts

2 Comments »

  • Admin (author) said:

    Thanks for interest in this blog!!
    As per your comment, if we click the primary check box in the MVG, it will change the Primary record for the MVG.
    The solution I have given is from perspective, that when a User closes the MVG applet, and the selected record in the MVG is any other record which is not Primary.
    So, in this case, the other record becomes visible in the MVG field of Parent. He can very well refresh the parent record, that will show him the Primary record. But he don’t want to do a ALT+ ENTER or Refresh Record after closing the MVG.

    Hence, we have to go with approach so that when he closes the MVG, only Primary records becomes visible in the MVG field, and not any other record.

  • Satya said:

    hey …thts good
    but i have a doubt….that why we need to write this script….
    …we can do it by just clicking the primary check box given in the mvg applet..
    is that right…

    pls let me know..

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.


Verify Code   If you cannot see the CheckCode image,please refresh the page again!