The following VBA example shows how a macro file can be started from VBA. This particular example will close Microsoft Dynamics GP when the Check Links window closes. As macros wait for background processes to complete, the macro will not start until the Check Links process and report have completed.
The code will create a text file with a .mac extension with the appropriate macro language command to exit Microsoft Dynamics GP as though the user selected File >> Exit. It then runs the macro file. To make this possible we are executing pass through Dexterity sanScript using the Continuum Integration Library.
NOTE: This customisation uses a method of executing Dexterity sanScript code from VBA which is unsupported by Microsoft.
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 on Vaidy Mohan's Blog
Posting on Mohammad Daoud's blog
If I wanted to use this technique to populate serial and lot line items on the sales transaction screen, would I still write a macro and then call the macro from the script? Or could you jwrite Dexterity code instead and execute the code using the ExecuteSanScript command? I guess I'm confused as to the difference between the code in the macro and actual Dexterity code.
This is a good code. I wish you make more examples on this and expand the subject.
Post from Jivtesh Singh at About Dynamics, Development and Life
Nice code... Do you think it could be use also as a timed / scheduled task to log off automatically a user past a certain time ? We do use the OminTools / GP Toolbox to log off users after a predefined inactivity timeout, but in certain cases where users are on the exception list, those user tend to forget to close their GP session at the end of the day..
Thanks for your tips
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.