One of the customisations that I have heard requests for a number of times is to open the General Ledger Journal Entry (GL Transaction Entry) window's scrolling window (grid) to its expanded state when the window is opened.
The method to make this happen is to use Visual Basic for Applications (VBA) to "press" the expand button as though the user has clicked on the button. However, when most people try to create this customisation, they end up receiving the following error message.
Run-time error '1008': Unsafe Operation. An attempt was made to set a value into an application field which is disabled. This operation could compromise the integrity of the application.
This is because the "button" that we see is actually a non editable visual switch field used to display the graphic icon. The actual button that we need to press is an editable, but hidden field. Additional steps are needed to temporarily make the field visible so that it can be added to VBA.
The Knowledge Base (KB) articles below discuss this issue further and provide the steps to create the working customisation:
Error message when you expand a scrolling window by using VBA in Microsoft Dynamics GP: "Run-time error '1008': Unsafe Operation" (KB 951231) How to add a hidden field by using Modifier together with Visual Basic for Applications in Microsoft Dynamics GP (KB 951230)
Error message when you expand a scrolling window by using VBA in Microsoft Dynamics GP: "Run-time error '1008': Unsafe Operation" (KB 951231)
How to add a hidden field by using Modifier together with Visual Basic for Applications in Microsoft Dynamics GP (KB 951230)
There is another unsupported method which you can use achieve the same result. This method works by adding another visible field to VBA as a placeholder, and then editing the exported package to change the placeholder field details to the actual hidden field we need to reference.
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.
David
Post from Jivtesh Singh at About Dynamics, Development and Life
www.jivtesh.com/.../dynamics-gp-customizations-best.html
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.