Sort Companies list by ID

sneha
sneha Member Posts: 191
We are on 5.0 and we've around 8 companies in our database. The companies are sorted by Name when the user selects "Open Company". But, the user wants to see it in different order. I think, a new filed "ID" can be added to Company table to achieve this. But, not sure where can I write the code in codeunit 1 (or) 2 to sort it by ID?

Thanks for your help!

Comments

  • Luc_VanDyck
    Luc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can't sort this list through code. The user needs to press Shift-F8 to sort it.

    Another option might be to include the ID in the Companyname:
    001 - Company Z
    002 - Company A
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • sneha
    sneha Member Posts: 191
    We will append the ID if we create a new companies but, don't we need to rename the company if we need to append the ID against existing companies? I think, it is more dangerous in our case, considering integration, consolidation, etc..
  • sneha
    sneha Member Posts: 191
    Any more thoughts on how to sort the companies list?
  • sneha
    sneha Member Posts: 191
    How to hide the inactive companies from the Open Company screen? please suggest..
  • sneha
    sneha Member Posts: 191
    I've added a new field called "Sort By" to company table. And, added it to keys. Now, I want to sort the Open company window based on my new field "Sort By". Is it possible? please suggest...I don't think changing the primary key is a solution.....
  • Luc_VanDyck
    Luc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Read my first answer again: "You can't sort this list through code. The user needs to press Shift-F8 to sort it.".
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Andwian
    Andwian Member Posts: 627
    sneha wrote:
    How to hide the inactive companies from the Open Company screen? please suggest..
    Specify the Roles with the only active companies.
    Regards,
    Andwian
  • sneha
    sneha Member Posts: 191
    Thank You Andwian! Yes, I was able to hide the inactive companies but, still not able to sort the companies the way we want without renaming. Sounds like, it is not possible.