Sorting Filter

How can I change Sort Key? Ex: Item card Instead of sort by item number, I want to choose unit price. Thanks

Hi Field on which u want sort table u can make its secondary key and using SETCURRENTKEY(fieldname) u can sort records in table. Hope this is what u want to know [:I] Regards, Rajesh

Don’t create a key “Unit Price”. This not the way Navision works.

Hi Emiel

quote:


Originally posted by eromein
Don’t create a key “Unit Price”. This not the way Navision works.


You are right. But you should explain why he shouldn’t create this key [;)]. bye André

Is it Navision Methodology or anything else? I created a key for Decimal field and it works fine [:)]

Actually, they all will work fine (unless you are trying to sort by a flow field) [;)] I think what Emiel meant was that it’s not Navision’s philosophy to create keys for each and every field you want to use for sorting. First off, you are limited to 40 keys (in 2.60, dunno about other versions). Second, each key results in performance loss when accessing the table. Third, most tasks that a user wants to accomplish by sorting are more easily achieved by filtering. Fourth, keys are usually used for speeding up filtering and CALCSUMS operations in reports etc. These keys usually comprise several fields and are therefore relatively useless for viewing in a form. Fifth, you can always copy and paste the data into Excel and sort it there [:p] Other people will definitely find a few more reasons [:D]

Sorry, I feel I still do not get my question answer. By the way I am a Navision beginner. Get back to my question: Can I change the key filter without doing any programming? (It is a scary thought) I thought I saw somewhere in this forum that you can do it. Forget where. Probably going to object designer, select table, design, view…and lost direction. Very appreciated for any effort to this question.

Interestly, where is this site based at? I just posted a new topic. My local time is 8:26 PM but the New Topic post time is 3:26. Thanks

quote:


Originally posted by euronail
Interestly, where is this site based at? I just posted a new topic. My local time is 8:26 PM but the New Topic post time is 3:26. Thanks


As far as I know the site is hosted in Denmark [:p]. btw. Can you please explain where and why do you want another key. In a form or while running code? I a form you can change the key with Shift + F8. While running a code (e.g. a report) you can change the key with SetCurrentKey. Or do you want create a key? Then go to the designer, select the table, design, View => Keys. Be carefull with the other keys. bye André

Thanks Andre For example: GL entries - instead of sort by doc number and doc date, I want it to be the opposite. Item list - Navision only offers option sort by No or search description,Vendor item no/Vendor No… Basically I want to have the option to select sort fields that I want. Thanks

Ah, it works. Thanks so much Andre. You guys are great. Your last option is what I wanted. Table / Design / View / Keys What do you mean I have to be careful with “other keys”? And what is that SumIndexfields? What do you use it for? Thanks again

Hi

quote:


Originally posted by euronail
Ah, it works. Thanks so much Andre. You guys are great. Your last option is what I wanted. Table / Design / View / Keys What do you mean I have to be careful with “other keys”? And what is that SumIndexfields? What do you use it for? Thanks again


To be careful with other keys means: you can run into a lot of trouble if you change or delete a key without knowing where the key is used. With the SumIndexfield you can select a field which is calculated all the time. You can use this field on forms and reports to show the sum of the filtered records. e.g. in G/L entries: Balance bye André