Home » Listing Details
Top Websites
  1. Dynamics GP Help
    Over 6100 resources listed.
  2. Mark Polino's DynamicAccounting.net
    Over 5100 resources listed.
  3. Rose Business Solutions Blog New
    Over 2200 resources listed.
  4. Developing for Dynamics GP - By David Musgrave and the MS GP Dev Support Team
    Over 1100 resources listed.
  5. Mariano Gomez at The Dynamics GP Blogster
    Over 1000 resources listed.
  6. Microsoft Dynamics Partner Community Blog
    Over 900 resources listed.
  7. Christina Phillips, Steve Endow & Lorren Zemke at Dynamics GP Land
    Over 700 resources listed.
  8. Mohammad Daoud's Dynamics GP Blog
    Over 600 resources listed.
  9. Vaidy Mohan at Dynamics GP - Learn & Discuss
    Over 500 resources listed.
  10. Inside Microsoft Dynamics GP Official Blog
    Over 500 resources listed.
  11. eOne Business Solutions Blog
    Over 400 resources listed.
  12. About Dynamics, Development and Life
    Over 300 resources listed.
  13. Frank Hamelly at GP2theMax
    Over 300 resources listed.
  14. Dynamics CPM
    Over 300 resources listed.
  15. BKD Dynamics GP Insights Blog
    Over 200 resources listed.
  16. Leslie Vail at Dynamics Confessor Blogspot
    Over 200 resources listed.
  17. Victoria Yudin's Dynamics GP Website
    Over 200 resources listed.
    Victoria Yudin
  18. Janakiram M.P. at DynamicsBlogger
    Over 100 resources listed.
  19. VS Tools Forum
    Over 100 resources listed.
    Your Resource for Visual Studio Tools for Dynamics GP
  20. Inside Microsoft Dynamics GP Official Blog
    Over 100 resources listed.
  21. US Dynamics GP Field Team Blog
    Over 100 resources listed.
  22. Catherine Eibner MBS Developer Evangelist
    Over 100 resources listed.
  23. Sivakumar Venkataraman at Interesting Findings & Knowledge Sharing
    Over 100 resources listed.
  24. Dynamics Small Business
    Over 100 resources listed.
  25. Belinda, The GP CSI
    Over 100 resources listed.

ID:9002
Title:Hybrid - Changing Screen Colours Depending on Company Example
URL:http://blogs.msdn.com/developingfordynamicsgp/archive/2008/07/21/hybrid-changing-screen-colours-depending-on-company-example.aspx
Description:

This is one of my favourite examples mainly because it achieves something that most people thought was not possible with VBA. To be honest, it still is not possible with VBA alone.  This hybrid code uses the unsupported method of calling Dexterity sanScript from VBA to use the Dexterity commands to select and change colours.

This example was demonstrated at the Microsoft Dynamics GP Technical Airlift 2008 to show how you can have a Microsoft Dynamics GP for Barbie release, see screenshot below: 

Microsoft Dynamics GP for Barbie 

The Modifier is used to modify the form and create the additional buttons and fields needed.  Then VBA is used to add the scripting.  I created two VBA functions that do most of the work, SetColour and GetColour.  The SetColour function uses the Continuum Integration Library to execute Dexterity sanScript to set the background colours from values passed in.

The GetColour function is a bit more complex.  It also uses the Continuum Integration Library to execute Dexterity sanScript to open the colour selection dialog and store the results in the SY_User_Object_Store table. The SY_User_Object_Store table, which is the SY90000 table in the company database, is the table used for the VBA Dynamic User Object Store (DUOS) table.  As we are unable to pass parameters back from sanScript when executing it from VBA, we can store data in the DUOS table and then read that data from VBA as another method of returning data.  Storing the data in the DUOS serves a double purpose in this example, it allows the passing of the data back from Dexterity to VBA and stores the settings so they will be remembered next login.

The buttons on the Company Options window use these two functions to provide the user interface for the customisation. The final piece of the puzzle is the use of a Toolbar.package.  Even though the toolbar form is no longer visible in version 8.00 or later and so cannot be added to VBA, it can be added as a package and used to execute VBA code after login.  For our example, it is using the SetColour function to set the background colours for the current company based on the values read from the DUOS.

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.

WARNING: This posting and example contain International English spelling, use at your own risk. :-)

Category:SUPPORT (TECHNICAL): COMPANIES (Copy, Test, Delete)
Link Owner:
Date Added:June 17, 2010 02:12:44 AM
Number Hits:18
RatingsAverage rating: (0 votes)
Reviews

No Reviews Yet.

 
GPWindow.com

Thank you for your support for GPWindow. It helps us cover part of the hosting costs for GPWindow.