Page 1 of 6812345678910...2025303540...Last »

Using the Support Debugging Tool to create user accessible SQL Scripts – Part 3

David Meego - Click for blog homepageThis is the third and final article in the series, make sure you look at the previous articles before this one.

The previous articles can be found at:

Today’s article adds the final step by adding a method for a user to execute the code we have written so far without requiring access to any Support Debugging Tool windows.

The Runtime Execute window and SQL Execute windows are Advanced Mode features which makes them only available to users with access to the Administrator features via the security roles AND the system password (if used) AND SQL dbo or SysAdmin privileges. You would not want this sort of access to be given to the average user, so you can use the method in this article to provide access to the scripts we have written from an existing window.

Using the Automatic Debugger Mode we can create a non-logging trigger to call our scripts when an event occurs in the system. The event used can be any of the system events supported by Dexterity, such as opening or closing a window, moving focus in to or out of a field (with or without changing to the field), or clicking on a button. You can also create your own items on the Additional menu to trigger off.

For our example, we are going to use two methods; an additional menu and re-purposing the window print button on the Customer Maintenance window.

Part 3: Exposing the script to any user

The final step is to use Automatic Debugger Mode Setup to call our previously created Runtime Execute script.

  1. Open the Support Debugging Tool main window (Microsoft Dynamics GP >> Tools >> Support Debugging Tool or Ctrl-D).
  2. Open the Support Debugging Tool Setup window (Options >> Setup Automatic Debugger Mode).
  3. Enter the Trigger ID, Trigger Description as desired for menu based trigger.
  4. Check the Start Trigger Automatically on Login, Do not activate Logging Mode and Minimize Debugger Log Entries checkboxes.
  5. Select the Trigger Type: Add Form Menu, Trigger Event: Form Level, and Trigger Attach: After Menu Selected.
  6. On the Resource tab, select Product Name: Microsoft Dynamics GP, Form Name: RM_Customer_Maintenance, Menu Entry: Check and Update Hold, Accelerator Key: U.
    Trigger1
  7. On the Script tab, set Context: Microsoft Dynamics GP and the script to:
    out boolean OUT_Condition;
    local text MBS_Text_Field;
    local integer MBS_Dictionary;
    local integer MBS_Status;
    
    OUT_Condition = false;
    
    if isopen(form RM_Customer_Maintenance) then
    	OUT_Condition = true;
    
    	call with name "MBS_Script_Load_Dex" in dictionary 5261,
    		"DEMO1", MBS_Text_Field, MBS_Dictionary;
    
    	call with name "MBS_Runtime_Execute" in dictionary 5261,
    		MBS_Text_Field, MBS_Dictionary, MBS_Status;
    	if MBS_Status <> OKAY then
    		warning MBS_Text_Field;
    	end if;
    
    end if;
    

    Trigger2

  8. You can use the Helper Button at the bottom of the window to insert Helper Functions at the current cursor location for loading and executing the Dexterity Runtime Execute script. Variables needed will be automatically added to the top of the script.
  9. No changes needed on the Actions and Options tabs
  10. Click Save.
  11. Enter the Trigger ID, Trigger Description as desired for button based trigger.
  12. Check the Start Trigger Automatically on Login, Do not activate Logging Mode and Minimize Debugger Log Entries checkboxes.
  13. Select the Trigger Type: Focus Event, Trigger Event: Field Change, and Trigger Attach: Before Original.
  14. On the Resource tab, select Product Name: Microsoft Dynamics GP, Form Name: RM_Customer_Maintenance, Window: RM_Customer_Maintenance, Field Name: WindowPrint.
    Trigger3
  15. On the Script tab, set Context: Microsoft Dynamics GP and the script to:
    in string IN_OldValue;
    in string IN_NewValue;
    out boolean OUT_Condition;
    
    local text MBS_Text_Field;
    local integer MBS_Dictionary;
    local integer MBS_Status;
    
    OUT_Condition = false;
    
    if isopen(form RM_Customer_Maintenance) then
    	OUT_Condition = true;
    
    	call with name "MBS_Script_Load_Dex" in dictionary 5261,
    		"DEMO1", MBS_Text_Field, MBS_Dictionary;
    
    	call with name "MBS_Runtime_Execute" in dictionary 5261,
    		MBS_Text_Field, MBS_Dictionary, MBS_Status;
    	if MBS_Status <> OKAY then
    		warning MBS_Text_Field;
    	end if;
    
    end if;
    

    Trigger4

  16. You can use the Helper Button at the bottom of the window to insert Helper Functions at the current cursor location for loading and executing the Dexterity Runtime Execute script. Variables needed will be automatically added to the top of the script.
  17. On the Actions tab, check the Issue Reject Script checkbox to prevent the original button script from running after our trigger code finishes.
  18. No changes needed on Options tab.
  19. Click Save.

To automatically enable the triggers, just log in again to the company. To manually enable the triggers, from the Support Debugging Tool main window, select Turn On Automatic Debugger Mode >> Non Logging Automatic Start Only. To disable the triggers, from the Support Debugging Too main window, select Options >> Automatic Debugger Mode Status and then click Unregister >> Non Logging Triggers Only. To disable all triggers, use Unregister >> All Triggers, this is required if you want to open the Setup Automatic Debugger Mode window again.

Notes

  • Use the Automatic Debugger Mode Status window (Options >> Automatic Debugger Mode Status) to confirm that the triggers are registered and active.
  • Note that the target window must be closed and re-opened after the triggers are enabled before they will be active.
  • If re-purposing an existing button, you can use an ask() dialog to ask if you want the original purpose or the new purpose to execute. For the original purpose, exit the script with the variable OUT_Condition equal to false. For the new purpose, perform the desired actions and exit the script with the variable OUT_Condition equal to true and the action Issue Reject Script ticked.
  • If you are having problems getting the code to work, uncheck the Minimize Debugger Log Entries checkbox to get more information recorded in the Debugger__.log file.
  • It is possible to load and execute the SQL Execute scripts directly using the Dexterity trigger code and bypass Step 2 of this series using Runtime Execute, however this makes it harder to test the code as you will need to keep registering and unregistering the trigger.

Below is the Debugger Settings files with all the code for the examples in this series.

Please write feedback and comments below to let me know how you think you could use these methods in your systems.

Hope you found this series useful.

David

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: Development, Dexterity, Dynamics, GP, Microsoft, Products, SQL Server, Support Debugging Tool Tagged: Application, Dexterity, SDT, SQL, Support Debugging Tool

Originally posted here:
Using the Support Debugging Tool to create user accessible SQL Scripts – Part 3

May 18, 2015 · WinthropDC · No Comments
Tags: , , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 13

Using the Support Debugging Tool to create user accessible SQL Scripts – Part 1

David Meego - Click for blog homepageIt has been a while since I have posted a technical article on the blog. This is because I am spending almost all my time working on bringing some existing and new products to market.

I am still working on the rebranded and improved release of the Support Debugging Tool. There will be a number of improvements in its features and navigation, more on that soon.

For now, I wanted to post a really clever method of using the Support Debugging Tool to provide additional functionality to end users.

At the reIMAGINE 2014 conference in Fargo last November, Mariano Gomez and I demoed a method of creating a user accessible SQL script. The series covered in the next few posts will take you through the steps to create your own scripts on your system.

The Scenario

I will use the same scenario as we demonstrated at the conference. This will help explain the techniques involved so you can create your own examples.

For our example, we will use queries to check for customers that are marked as on Hold and update customers on Hold to remove the Hold flag.

The end result we want is a user accessible menu entry which can be used to display any customers on Hold which meet a user entered “Begins with” value and then have the option to clear the Hold flag.

Note: The series assumes that the Support Debugging Tool is installed using the Recommended Configuration (shared setup file location) and that you have Advanced Mode features enabled and available to you.

Part 1: Create the SQL Queries

The first step is to use SQL Execute to create and save the SQL queries needed to display and update the data.

  1. Open the Support Debugging Tool main window (Microsoft Dynamics GP >> Tools >> Support Debugging Tool or Ctrl-D).
  2. Open the SQL Execute window (Options >> SQL Execute).
  3. Enter the Script ID, Script Name and script for your display query:
    select Customer Number from RM_Customer_MSTR where Hold <> 0

    SQLScript1

  4. Click Save.
  5. Enter the Script ID, Script Name and script for your update query:
    update RM_Customer_MSTR set Hold = 0 where Hold <> 0

    SQLScript2

  6. Click Save.

Notes

  • You can use Dexterity Technical Names in your queries if they are surrounded by braces  and SQL Execute will convert them to physical table and column names before execution for you.
  • If you want more than 20 rows returned for the display query, you can change or remove the limit.
  • If you want the query execute against the System database or a specific company database, you can change the Execute Query context drop down list.
  • If you wish to be able dynamically change the query ensure that you can make your changes by adding code at the beginning or end of the script. This can be achieved by setting a variable at the beginning of the script or by adding where clause to the end.
  • You can use more descriptive Script ID and Script Names for your scripts.

More to come on the next post.

David

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: Dexterity, Dynamics, GP, Microsoft, Products, SQL Server, Support Debugging Tool Tagged: Application, Dexterity, SDT, SQL, Support Debugging Tool

Read More:
Using the Support Debugging Tool to create user accessible SQL Scripts – Part 1

May 11, 2015 · WinthropDC · No Comments
Tags: , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 20

Update: Positive Thoughts for Leslie Vail

David Meego - Click for blog homepageJust wanted to post a quick update from my friend Leslie Vail after my original post:

I heard from Leslie today that the surgery went well and she is now resting comfortably.

She wanted to thank everyone for their positive thoughts and lovely comments.

Please keep the positive vibes flowing as Leslie continues on the road to recovery.

We need her well and back at the conferences. No-one else can wear the capes like she does.

MarkCape
Mark Rockwell trying to emulate Leslie

JohnCape
John Lowther playing Leslie when he co-presented with her

LeslieJenniferSheila
Leslie, Jennifer (my wife) and Sheila from Convergence 2012

LeslieCape
Leslie and the famous golden GPUG cape at Convergence 2011

Get well soon.

David

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: News Tagged: General, News

More:
Update: Positive Thoughts for Leslie Vail

April 21, 2015 · WinthropDC · No Comments
Tags: , , , , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 33

BlackBox – The First Dexterity Game

David Meego - Click for blog homepageIt has been many years since my BlackBox game got a mention and so I thought it was time to bring it up again.

I first wrote the game BlackBox for Dexterity in 1999 while I operated as Winthrop Dexterity Consultants. The game is based the original board game by Eric Solomon and was created with his kind permission.

The concept of the game is to find the location of a number of atoms hidden in a 8 by 8 grid.  Your only method of looking for the atoms is to “fire” beams into the grid from the edges of the grid and see if the beams are absorbed, reflected or deflected.

During my childhood, this was one of my favourite games and I had already written versions for the Apple //e, the Commodore Amiga, and the Sharp PC-E500 pocket computer. So, I thought why not create one using Dexterity.

Here is a screenshot of the game:

BlackBox1Screenshot of the BlackBox main game screen

When I first created the code it was hidden as an “Easter Egg” in products I was selling at the time. When I sold Omni Security and Omni Field Security to Great Plains (Microsoft) as Advanced Security and Field Level Security, I had to remove the BlackBox game from the code.

Later when I first developed the MBS Support Debugging Tool, it contained the BlackBox game. But it had to be removed when I finally got permission to release build 9 publically as the Support Debugging Tool.

While I was at Microsoft, I was not allowed to add the game to anything I developed, so it was released as a separate BlackBox product and for the last many years it has been available as a free download on the Winthrop Dexterity Consultants Downloads Page and Products Page.

So, if you want to try the game out, head over to the Winthrop Dexterity Consultants Products Page and download the BlackBox.zip file. It works with all versions of Microsoft Dynamics GP.

Once the chunk is installed, you will find the BlackBox menu option on the Tools >> Customize menu. If you add it to Shortcuts or Quick Links, it can be played on the Web Client as well.

For more information, here are some related links:

Please add your comments to say what you think of the game.

Enjoy

David

PS: Its Dexterity Product ID is 900, so that should give you an idea or how old it is. New Product IDs are in the high 7000’s.

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: Dexterity, Dynamics, Fun, GP, Microsoft Tagged: BlackBox, Dexterity, Fun, Game

See the article here:
BlackBox – The First Dexterity Game

April 13, 2015 · WinthropDC · No Comments
Tags: , , , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 33

Friday Funny: Can you solve this simple puzzle

David Meego - Click for blog homepageRecently a puzzle has been doing the rounds on the Book of Face and I thought it would be good to test how quickly my readers could solve it. It is probably an oldie, but it is a goodie.

The puzzle is the Car Park Puzzle where you have to work out the missing number for the bay where the car is.

Can you work out the missing number in the sequence 16, 06, 68, 88, X, 98?

Please don’t post the answer in the comments, just let me know how long it took you to solve the puzzle.

CarParkPuzzle

Have Fun.

David

PS: I might post the answer at some time in the future…. or I may not. :-)

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: Fun Tagged: Friday Funny, Fun

View article:
Friday Funny: Can you solve this simple puzzle

April 10, 2015 · WinthropDC · No Comments
Tags: , , , , , , ,  · Posted in: Blogs I Follow Total Views: 42

Visual Studio Integration Toolkit replaces Menus for Visual Studio Tools

David Meego - Click for blog homepageGreat news for Visual Studio developers.

Winthrop Development Consultants are pleased to announce the release of the Visual Studio Integration Toolkit for Microsoft Dynamics GP (VSIT).

The Visual Studio Integration Toolkit replaces Menus for Visual Studio Tools and is now available for Microsoft Dynamics GP 2010, Microsoft Dynamics GP 2013 (including GP 2013 R2) and also for Microsoft Dynamics GP 2015.

The new name is to reflect the change of ownership as well as the future of the tool where its functionality will be extended to provide access to other “Dexterity only” integration features and not just the current menu navigation.

However, to maintain compatibility with existing installations and projects, the file and object names have not been changed.

The new product releases replace the existing code for GP 2010 and GP 2013 as well as adding the long awaited version for Microsoft Dynamics GP 2015.

Note: The original code for Microsoft Dynamics GP 10.0 is also available, if needed.

Thank you for your patience as the agreement with Microsoft was reached and then the updated code and documentation was developed.

Important: When installing the new code on a system which already has the existing code, you will be asked to restart Microsoft Dynamics GP to complete the renaming of the product. You will also need to remove and re-add your reference to the Application.MenusForVisualStudioTools.dll assembly in your Visual Studio projects.

For more information please see the Visual Studio Integration Toolkit Portal page:

More information on the additional functionality being added to the registered version will be posted on this blog, so watch this space.

Please post comments and feedback.

David

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: 2010, 2013, 2013 R2, 2015, Development, Dynamics, GP, Menus for Visual Studio Tools, Microsoft, News, Products, Visual Studio, Visual Studio Integration Toolkit Tagged: Menus for Visual Studio Tools, MVST, News, Visual Basic .Net, Visual C#, Visual Studio, Visual Studio Integration Toolkit, VSIT

Excerpt from:
Visual Studio Integration Toolkit replaces Menus for Visual Studio Tools

April 9, 2015 · WinthropDC · No Comments
Tags: , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 46

#CONV15 – Convergence 2015 Atlanta – Wrap Up

David Meego - Click for blog homepageConvergence2015

Convergence 2015 in Atlanta, Georgia, USA has come to an end and it is now time to post the final wrap up.

I really enjoyed the social and networking aspects of the conference and loved presenting. It is also great to hear feedback from customers and partners about how the work done in the community (forums, blogs, etc.) is appreciated.

As promised here are the source code files and development environment from the CSG024: Microsoft Dynamics GP: Customizing the User Interface session as well as the link to the Company Login example used.

Below are all the posts for Convergence 2015 Atlanta from this blog:

I hope you enjoyed the series.

If the rumours are correct and that Convergence will be changing to have less Dynamics focus, less technical content and less Microsoft Dynamics GP content, then I think I will be focussing my travel arrangements on the smaller GP specific events listed below.

Just one last quick reminder to mark your calendars for the upcoming events

  • reIMAGINE 2015 in Fargo, ND, USA on 21-23 September 2015
  • GPUG Summit 2015 in Reno, NV, USA on 12-16 October 2015
  • PreGame at Summit 2015 in Reno, NV, USA on 13 October 2015

Hope to see you at there.

David

This article was originally posted on http://www.winthropdc.com/blog.

Filed under: Conference, Dynamics, GP, Microsoft, News Tagged: Conference, Convergence 2015, News

View article:
#CONV15 – Convergence 2015 Atlanta – Wrap Up

April 6, 2015 · WinthropDC · No Comments
Tags: , , , , , , ,  · Posted in: Blogs I Follow Total Views: 55