Table keys not recognized in report

I’ve created a report that does some cycling through the Posted Sales Invoices tables (both header and lines). To increase the efficiency of the report I created a new key, and implemented it in the report like this: PostedInvoiceHeader.RESET; PostedInvoiceHeader.SETCURRENTKEY(“Job No.”, “Milestone Code”); Nothing tricky. So I test the report and it runs well. And I export the report (FOB file) and send it to the client. He imports the FOB file and calls me back to say the report won’t run because table 112 is missing a key. OK, I walk him through how to create the key. He does, and it works well. The report still won’t run, because it thinks the key doesn’t exist. So I tell him to close Navision and open it again (he runs a test copy as a single user install). Still won’t run. Same reason. So I export my copy of table 112 (FOB file) and send it to him. He imports it. And yet the report refuses to run. I had him open the Keys view to make sure the key existed and that it was enabled. He said it was. The client is running US 2.00A. Any thoughts greatly appreciated.

Hi Just recompile that report and Try again. It is good practice to include error handles as far as possible. for example Variables fStatus Boolean PostedInvoiceHeader.RESET; fStatus := PostedInvoiceHeader.SETCURRENTKEY(“Job No.”, “Milestone Code”); If fstatus // key is successfully set. do processing… Else // prompt Error message Regards Joseph Mathew

Hi We can see these type of interesting things in Navision. For eg. Just open a test report. Go to section designer. Then open the table in design mode which is used in the report . add one new field to that table. Save the table. Again come to the section designer of report. open field menu. Here we can seen the new field. insert the new field in the body section. Then Try to compile that report. ??? It will gives error. ‘Variable not found’. Why navision will not allowed to insert this fields into the section even if from field menu ??? Every thing is ok if we close the report and come again. Regards. Joseph Mathew

Recompiling the report (and the table) did not help. Joseph, the situation you describe in your second post is, I believe, part of the versioning properties (or optimistic concurrency) that is part of the integral design of the product.

Hi Matt If it is a versioning property then it will not allow us to seen the new field in the field menu. Since the new field is shown in the field menu I can’t believe that the problem is because of versioning. (versioning is one of the good feature in the Navision) Regards. Joseph Mathew

The problem is resolved. The client created two different keys, rather than creating one key with two fields. Which begs the question, why wasn’t the key installed with my FOB file of the table?

If the table was imported with the action “Merge: Existing<-New” then the keys will not be updated, only new fields are added. You must use the “Replace” action for keys to be updated.