I have date field named ENDDATE in a BC, i need to display the latest records in the applet based on this date field using applet level java script so need the records should be in desc based on this date, can anybody help me with the script and the implementation on which event i should deploy this script, i am using siebel 8.0
To sort the records in an applet, you SHOULD NOT be using scripting. You should either set the sort spec on the buscomp, or you should create a PDQ with the sort spec you need. If you tried setting the sort spec on the buscomp and that didn't seem to work, then you probably have All Mode Sort enabled and should consider disabling it.
However, if you still feel like you want a hack solution and you only want it to affect the buscomp when it's backing a specific applet, then you can add a script like this to the applet server script event WebApplet_Load (but I don't recommend it):
BusComp().RefineQuery(); BusComp().SetSortSpec("ENDDATE(Desc)"); BusComp().ExecuteQuery();