key active for just one company?

ReinhardReinhard Member Posts: 249
Hello...
I restored a database to a test location, but I didn't restore the keys in the payroll ledger entry table, it was taking too long.
Now I wanted to run some payroll functions, I got an error that the key doesn't exist, and I had to activate it. That went fine...
When I wanted to run the same function in the other company, but it gives me the same error about the missing key. However the key is active and enabled, and the SIFT levels are all there. I can't seem to fix the problem... since it has already been fixed?!... I tried to reactivate but that didn't help either.
Thank you so much for any suggestions or additional info you might have!
- Reinhard

4.0 SP3 Native

Answers

  • WaldoWaldo Member Posts: 3,412
    HOw did you do the restore? SQL restore or NAV-classic-client-restore?
    Seems odd to do this without restoring keys..

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • ReinhardReinhard Member Posts: 249
    Native restore.

    Yes it was odd... however I figured out that wasn't the problem.

    The error message that displays:
    The sum of the values in the Amount field cannot be calculated because the current key does not contain all the fields being filtered.
    You must select a key that contains the fields in the filter. The order of the fields is unimportant.
    Filters:
    Employee No.:...
    Payroll Control Type:...
    Payroll Control Name:...

    Basically the error message cuts off after a certain amount of characters, and didn't display ALL the fields being filtered on.

    I stepped through it with the debugger saw that indeed the current key did NOT have all of the fields being filtered.
  • WaldoWaldo Member Posts: 3,412
    OK .. that sounds more like a forgotten sumindexfield :-).

    I suppose it's solved then.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    The best way to fix this is to go back to the original database and export all Table objects. Then import them to the new database with a REPLACE ALL. This will go through and reactivate the keys correctly. That's how I normally fix it.

    This issue happens a lot if you interrupt the restore process. Often what happens is that in a particular table, the key is activated and sorted, but you killed the restore before it created all the SIFT, and if you look you will see some un-ticked.
    David Singleton
Sign In or Register to comment.