How is a NEW key added to a Table? Customer Table?

emulsified
emulsified Member Posts: 139
My goal is to print Customer Labels sorted in Ascending order by Post Code/Zip Code.

I have created LABEL reports with report writer. It seems the only closest KEY I can SORT by is "City, State, Zip" which is not what I need to do. :shock:

We send BULK MAILERS & CATALOGS via USPS and these labels need to be in order by Zip Code.

I have been using NODBC with Excel and Word Avery Templates to accomplish this on a temporary basis. :evil:

:?: How do I add a KEY "Post Code/Zip Code" to the customer table so that I may use the following in my On-Pre sections:
SETCURRENTKEY("Post Code");
ASCENDING(TRUE);

I am not really interested in using a temptable, want to keep coding to a minimum.

:D Any help would be great...
Half-empy or half-full how do you view your database?

Thanks.

Comments

  • anand_sri12
    anand_sri12 Member Posts: 71
    In the customers tables design view

    go to view>keys & add the new keys you needed
    With thanks

    Anand Kumar
    Navision Technical Consultant
  • emulsified
    emulsified Member Posts: 139
    \:D/ Added the KEY for Zip Code and now I have my sort I needed!
    :arrow: Now the fun of making the report align to Avery 5260 mailing labels. If only a template report existed. :-k
    Half-empy or half-full how do you view your database?

    Thanks.
  • Waldo
    Waldo Member Posts: 3,412
    You can easily change the report to match your lables. Just see how it's been set up now, add your own option and section, set up you field length and such, and you're done.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • ivanlotter
    ivanlotter Member Posts: 31
    Hi,

    My developers License doesn't allow me to change the key on the table so that my reports sorts properly.

    How do I change the way the report sorts without having to add a key in the table?

    I need this specific report to first sort on, Picking Slip No. in the key below.

    Reservation Status,Source Type,Source Subtype,Source ID,Source Ref. No.,Picking Slip No.,Picking Slip Line No.
    Ivan Lötter
  • Waldo
    Waldo Member Posts: 3,412
    Are you trying to change a key, or to add key?
    If you have a dev license, you should be able to add a key in any table (except tables from an add-on).

    Keep in mind, if you add a key for only this report, I suggest you to uncheck the "maintainSQLIndex" property.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DenSter
    DenSter Member Posts: 8,307
    ivanlotter wrote:
    How do I change the way the report sorts without having to add a key in the table?
    I'm afraid that is not possible. NAV needs a key to be able to sort. It cannot sort without a key.
  • Waldo
    Waldo Member Posts: 3,412
    And you have to take this in the most positive way.

    If you let users sort in whatever way/field possible ... you're going to kill the performance. That's the main reason behind it, and very normal for any application.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog