It has been a while since I posted some example code, so here is one which demonstrates how to write back data using ADO.
The following VBA example adds the Item Short Description and Standard Cost fields to the Item Transaction Inquiry window and reports. It also allows the Standard Cost to be edited and updated back to the Item Master table.
The VBA code opens the connection when the window or report is opened and closes the connection when the window or report is closed. The script also uses two record sets, one which is read only to retrieve the fields from the Item Master (IV00101) table and the other to enable the updating of the Standard Cost field.
NOTE: The method of opening an ADO connection to SQL Server differs for each version. v8.00 uses the external RetrieveGlobals.dll, v9.00 use the external RetrieveGlobals9.dll and v10.00 uses the built-in UserInfoGet object. v10.00 will need at least Service Pack 1 to use this sample.
The Knowledge Base (KB) article below demonstrates the different methods:
How to use ActiveX Data Object (ADO) with VBA on a window with Microsoft Dynamics GP and with Microsoft Business Solutions - Great Plains 8.0 (KB 942327)
Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.
Please see the "Installation Instructions.txt" file in each version's archive for more information.
PingBack from http://blogs.msdn.com/developingfordynamicsgp/pages/modifier-vba-samples.aspx
Posting from the Dynamics GP Blogster
Post from Jivtesh Singh at About Dynamics, Development and Life
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.