Order customer lis by "No."

cariokacarioka Member Posts: 20
HI,

On Form Customer List I change on the SourceTableView SORTING("No.") for my list shows sort by "No.".
But when i lunch the form the number 12399 show before the number 124

help me?

Comments

  • kapamaroukapamarou Member Posts: 1,152
    No. is not a number but text. The sorting is different between SQL server and native database.
  • jannestigjannestig Member Posts: 1,000
    Did you select the criteria from sorting defaults ?

    I changed mine to

    SORTING(No.,Document Type) ORDER(Ascending)

    and it worked straight away
  • krikikriki Member, Moderator Posts: 9,110
    That means you are on SQL and SQL by default sorts code-fields as text.

    You can do 2 things:
    1) change the property SQL "SQL Data Type" to Variant or Integer. But that means that ALL FIELDS where an "Item No." can be put must be changed. And remember that in some (like T37,T39) can also be put a G/L Account or FA,...
    2) Better is to rename your items so they have the same lenght Like "12399","00124".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • cariokacarioka Member Posts: 20
    jannestig wrote:
    Did you select the criteria from sorting defaults ?

    I changed mine to

    SORTING(No.,Document Type) ORDER(Ascending)

    and it worked straight away
    dont run.

    another solution?

    if i created one field integer with the value of "No." and i sort by this field.... ????

    Thanks...
  • kapamaroukapamarou Member Posts: 1,152
    You would be adding:
    1) Unnecessary fields.
    2) Unnecessary Keys.
    3) Unnecessary Code to update the field every time a record is inserted.

    I would prefer renaming the customers from 1 to 00000001 or C00000001 or something similar.
    It's up to you... :D
  • krikikriki Member, Moderator Posts: 9,110
    :oops: I read items and it was about customers. But if you change items by customers in my post, it remains valid.
    kapamarou wrote:
    I would prefer renaming the customers from 1 to 00000001 or C00000001 or something similar.
    It's up to you... :D
    That's the best solution!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • garakgarak Member Posts: 3,263
    The reason is, that SQL have a correct sort order and the native didn't
    viewtopic.php?f=23&t=29589
    Do you make it right, it works too!
Sign In or Register to comment.