I try to get the records of a table in a specific order.
So Setcurrentkey could help me do this.
There is a key defined in NAV but I do not know what to give to the SetCurrentkey as parameter.
1st parameter is the table, but the second is the key. But what shoukd be the value of the key. Must this bey the fieldnumber of the field on which the key in NAV is defined or the field number of the field in the overview of the keys.
example: If I look at the keys on a specific tabel there are for example 3 keys:
No.
Country
City
If I want city do I use 3 as Key value or do I use CF.FieldNo(Table, "City") as valu of the parameter Key.
I tried both ways but the records are not returned sorted as I want to.
0
Comments
to answer your questio, press F1 in the C/AL designer and search "setcurrentkey"..you'll obtain the syntax.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
It is not in NAV that I do this , it is in Microsoft office Word using VBA and the C/Front OCX. So the help of C/AL will not help me in this case.
it was strange, as i've seen that carlo joined mibuso in 2003...sorry.
P.S.: i've no experience with c/front, but i think you have to pass the table and the "cardinal" number of the key (i don't know if it starts from 0 or 1). About your example, if you want to use "city" key i think you have to pass (table,3(or 2))
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I tried 3 already but no result. I tried 2 now but still no change in the sorting of the result.
Someone else who has experience with this.
From the help file: