GET command

What whould I use instead of GET when I what to use a secondary key. Thanks

GET works on primary key. You need to use setcurrentkey, setfilter, setrange, find.

Is there anything else other then find. What I am trying to do is edit the Sales Tax Collected report so it shows the Tax Exemption No. from the posted rental header. At first I was grabbing it from the customer table but they want it from the posted rental header table. Customer was nice because I could use get but the primary key for the posted rental header is document type and document No. and I want it to go by Sell-to Customer number. Thanks Ace

If you are trying to avoid testing the records one by one, here is what you can do: 1- Use the SETRANGE or SETFILTER to keep only the records matching your criteria 2- Rec.FIND(’-’) will give you the first record matching the criteria(or your record if it is unique) If there is more than one occurence, the results are sorted according to your current key (SETCURRENTKEY) Am I wrong or there is no “posted rental header” table in Navision?

One question. Why are they wanting to get the Exemption No from the Posted Rental Header? Is it becuase it can change for each rental, or be changed over time and so the one from the Customer table is not always the correct one? If Yes then you would have to search the Posted Rental Header by some key other than the Customer No., for instance the Sales Invoice No. if it is there, otherwise you will never be sure you have the correct No.