This presentation uses a real-world example to walk you through all steps of a small Microsoft Dynamics NAV software modification. Even if your interest is not directed toward a tax problem, and you do not want to repeat this particuar modification in your NAV installation, you can still get a feeling on how to get started about modifiying Dynamics NAV.
Assume you contracted freelance lawyer John Doe. John uses the services of Legal Help Assoc. who handles his administrative work including cash receipts. John asked you to send all payments to Legal Help.
In Dynamics NAV you set up a Vendor Card for John using Legal Help's address. All year long payments to John are sent to Legal Help, and everything is fine.
At year end you need to send 1099 reports to John and to the IRS. Dynamics NAV generates both reports for you. The problem is both reports show Legal Help's address, but should show John's address. Is there a way you can send payments to one address and show another address on 1099 reports? On the Vendor Card, click
Related Information > Vendor > Order Addresses:
The Edit - Order Address window opens:
Dynamics NAV Order Addresses give you the ability to enter multiple addresses for the same vendor. Could you use an Order Address as a 1099 reporting address? Yes, you only have to let the system know that a particular Order Address is to be understood as a 1099 reporting address. If you give the Order Address the Code 1099 the reports can use this Code as a marker for 1099 reporting addresses.
Vendor V00010 now has an Order Address 1099. The next step is to tell the system to use 1099 Order Addresses for 1099 reporting. In the Classic Client, open the Object Designer:
Report 10112 Vendor 1099 Misc is the one you will send to John. Report 10115 Vendor 1099 Magnetic Mediagenerates the flat file you will upload to the IRS Web site.
Open Report 10112 in Design mode. Write a note into the Documentation trigger so other programmers will notice and understand your modification.
In trigger Vendor - OnAfterGetRecord write the code between the green //<PC771> marks. This code fetches the Order Address coded 1099 for the vendor and prints it out. If the vendor does not have an Order Address coded 1099, the report prints the address found on the vendor card.
The report does not make any changes to the vendor record in the database.
As a last step, add your own marks, something like PC771 in column Version List for the objects you have modified. This is a great help for any programmer touching the database after you, especially when they perform the next software upgrade.
Author: Thomas Paulsen