Enable/Disable Key of Table During Run time

sanjeevasawalesanjeevasawale Member Posts: 63
Friends,

May be its silly query but wanted to know whether any way is there for it. Let me narate the whole sinario 1st -
I have defined new key in Sales Header Table for new customized report. Report is working fine. Now I dont want that new Key always be enabled so I disabled that key from table and it should only be enabled during execution of that report.

So friend is there any provision to do the same.

Comments

  • ara3nara3n Member Posts: 9,257
    If you are using SQL, you could write stored procedure and call it before the report is run, and after, which would enable and disable the key on Sql server. Personally I wouldn't worry about creating keys on Sales header. The table doesn't have that many records to worry about performance.
    I don't know how often you are going to run this report, but the performance on creating a key will worse than maintaining the key.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • sanjeevasawalesanjeevasawale Member Posts: 63
    I got another way of doing. Define KeyGroup and enable/disable that group. But how that I am currently checking. If any1 has any better suggestion do let us know.
  • kinekine Member Posts: 12,562
    You can use the KeyGroups for enabling/disabling the keys without entering the design. But you are not able to enable/disable it by code - it means you need to enable it manually (and this is exactly created feature for keys which are not needed through for example year and you need them only once per year for some reporting...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.