www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Sort Script
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
AT
Posted
I'm trying to use this script button (called sortcon) to sort a report:

function sortcon_onClick()
{
var crs = Application.activeTextbase.currentRecordset;
var sd = crs.newSortDescriptor();

sd.sortFieldName(0) = "consign";
sd.sortFieldFlags(0) = sd.FieldFlagREVERSE;
crs.Sort(sd);
Command.refreshWindow();
}

I have a "dummy" database in which is works perfectly but when I transfer it over to our live one it refuses to sort (though it does refresh!) I know the field labels are all correct and there is no compulsory sort set up for this report - is there anything else I might have missed? I've been staring at it for hours and I just can't work it out Confused
Amber
 
Posts: 63 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
As far as I can see the script should work.

I think you once again should look over if the naming is right. Does the tab really have the box name "sortcon" and the field name to sort in the database really named "consign". Without any BLOCK letters???

Or does some records miss information in the sort field "consign". If some empty records, they will be in the beginning of the list.


NEEngstrom
 
Posts: 40 | Location: Falun, Sweden | Registered: Tue September 17 2002Reply With QuoteEdit or Delete MessageReport This Post
AT
Posted Hide Post
Well your reply gave me confidence so I went in and just copied and pasted the button names and fields into the script and it now works! I can't figure it out 'cos from what I could see I pasted what was written there but as it's working now I shall worry no more!

Thanks for the reply Smile
 
Posts: 63 | Location: Essex | Registered: Fri April 29 2005Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Sort Script