Thursday, October 17, 2013

Open UI --> Custom Button In List Applet -- Not working

Hi

i tired to bring a Button in Open UI list Applet .once i mention the custom method name applet wont display properly !!!!!Anyone facing this issue ???

Regards
jo  

Scenario Config : Applet has to display only current year record at the initial load

Scenario : Applet has to display only current Year record at the initial load. But when i do a query an go it has to show all the records [ previous year records also]

ie :only on the applet load it has to show the current year records

My Solution :

 1)      At the time of applet load  --- Set one profile attribute  --This will make sure our code only fire at the time of loading the applet
a.       Set the profile attribute
b.      Set the some value to profile attribute
2
          2)In     function BusComp_PreQuery () before we entering to the code you have to make sure below two things
a.       Whether we are that active view
b.      Whether profile attribute got set or not
                                                               i.      if (TheApplication().ActiveViewName() == "<<ViewName>>" && TheApplication().GetProfileAttr("<<ProfileAttrib>>") == "<<value check>>")
                                                             ii.                      {<<Our code goes here >>           }
c.       Once we execute the code change back the profile attribute to previous value àimportant


Pseudo Code : 
function BusComp_PreQuery ()
{
               
var sSearchExpr;
               
                sSearchExpr = this.GetSearchExpr();
         if (TheApplication().ActiveViewName() == "<<ViewName>>" && TheApplication().GetProfileAttr("<<ProfileAttrib>>") == "<<value check>>")
                if (sSearchExpr != null && sSearchExpr != "")
                    {
                                var dtToday = new Date();
                                dtToday.setDate("1");
                                  dtToday.setMonth("0");
                               dtToday =dtToday.getDate() + "/" + ToNumber(dtToday.getMonth()+1) + "/" +                    dtToday.getFullYear();
                                this.SetSearchExpr("[Agreement Start Date] >='"+dtToday+"'") ;
                } // end of if sSearchExpr 
}// end of if Active View name 
               
return (ContinueOperation);
}

Agreement Start Date  à mention ur field name

Note:Please let me know if there is any other better approach to the above solution.

regards
jo
joju2002@gmail.com