Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

Resizing SmartList TreeView and ListView panes using the Support Debugging Tool

Resizing SmartList TreeView and ListView panes using the Support Debugging Tool

Rate This
  • Comments 7

David Meego - Click for blog homepageThis article is another Support Debugging Tool Non-Logging Trigger example and is a follow up to two previous articles:

This example stores the size and position of the SmartList window using a very similar technique to the post from earlier this week. The main difference is that instead of storing a setting in the Dex.ini file, this time it uses a Support Debugging Tool Parameter. These Parameters are stored in the SY_User_Object_Store (SY90000) table, this is the same table that Visual Basic for Applications uses for the DUOS (Dynamic User Object Store).

The reason that the code uses the DUOS table instead of the a Dex.ini setting is so that it can handle being used in a terminal server or Citrix farm environment.

Below is the reasoning:

  • If the setting was left as a Dex.ini setting, it would affect all users using the workstation and would not allow individual users to control the setting the way they wanted it. Each user can change the single setting and this will affect other users on that workstation.
     
  • Also in a farm environment, the Dex.ini setting on each of the servers on the farm is a different file and so has different settings. This means that the setting would change based on the server accessed for a particular remote session and so there is very little chance of consistency.
     
  • By using a Parameter stored the DUOS table, the setting is stored on a per user, per company basis and will follow the user regardless of the physical workstation or server being used.

The other big difference with this example is the enhancement to allow control of the size of the left hand (TreeView) and right hand (ListView) panes of the SmartList window. As mentioned in Mark's post, when the window is resized the size of the left pane increases to a point where it is much larger than required and is wasting a huge amount of screen real estate.


Example screenshot showing large amount of white space for left pane of Smartlist window

With this customisation, the size of the left pane can be set as a percentage of the total window size ranging from 5% to 95%. I have found that a value of 10% or 15% works well.


Example screenshot showing reduced amount of white space for left pane of Smartlist window

Notes:

  • To change the size of the left hand pane of the SmartList window, from the Additional menu, use the option "Change size of SmartList Window left hand pane". This will display the current percentage ratio value for the left hand pane and allow you to change it.
     
  • When the window is resized after the left hand pane has been made smaller, it is possible for the left hand pane to disappear entirely. If this happens, either use the menu option to re-select the size you want, or click on another window and then click back on SmartList window for the previously set ratio to be re-applied.
     
  • The position information is relative to the Microsoft Dynamics GP main application window and so can show negative figures when the window was last positioned higher than or left of the main window.

 

The example uses four Trigger IDs:

  1. SMARTLIST_POST
    This trigger captures the size and position information of the window and the percentage ratio of the left hand TreeView pane just before it closes and writes this information into DUOS table as the Parameter Win_SmartList.
     
  2. SMARTLIST_PRE
    This trigger reads the previously written Parameter and parses the line to size and position information. It then adjusts the SmartList window's size and position just before it is opened.
     
  3. SMARTLIST_SIZE
    This trigger adds the menu choice to the Additional Menu and allows the percentage ratio for the left hand pane of the SmartList window to be selected. Once a ratio is selected, the number of pixels needed to adjust the window fields by is calculated and the adjustments made. Also, the settings for the current size and position and percentage ratio are stored back into the Parameter.
     
  4. SMARTLIST_ACT
    This trigger works whenever the SmartList window gains focus. It reads the previously written Parameter and parses the left hand pane percentage ratio and then makes the appropriate adjustments to the window fields.

Use of the SMARTLIST_ACT trigger on the WindowActivate event was required as using the SMARTLIST_PRE on the Form Pre event was too early and the window field size changes did not take effect.

The Support Debugging Tool Debugger Settings file with these triggers is attached as an archive to the bottom of this post.

Please leave a comment if you find this example useful.

David

Attachment: Debugger Settings SmartList Window Size & Pane.dbg.zip
  • Thanks for the wonderful article... :) Smartlist pane resizing has been a topic quite some time and there are product suggestions which have been placed in Microsoft Connect. :) This is very helpful.

  • Posting from Jivtesh Singh at About Dynamics, Development and Life

    www.jivtesh.com/.../smartlist-left-pane-resizing-awesomeness.html

  • Posting Mark Polino at DynamicAccounting.net

    msdynamicsgp.blogspot.com.au/.../resizing-smartlist-treeview-and.html

  • How do you load the xml file?

  • Hi Alicia

    After loading the Support Debugging Tool. Goto Tools >> Support Debugging Tool and then use Options >> Configuration Export/Import to load the debugger settings xml file. Use the path button to find it and click Import.

    If you want all users to have this functionality, you will need to ensure the Support Debugging Tool is set up using the Recommended Configuration as described in the User Guide PDF.

    David

  • I was able to upload and implement the code, yet SmartList shortcuts are no longer working for my team (as they once were). I will need to roll this back - I'm just hoping I can! Thanks...

  • Hi Darin

    To disable the code, you can either mark the triggers as disabled or delete them entirely.

    From the Support Debugging Tool main window, select Options >> Automatic Debugger Mode Status and use the Unregister button to unregister all Triggers.

    Then select Options >> Setup Automatic Debugger Mode and click on the Administration Button. From there you can mark the triggers for deletion, mark them as disabled or set them to not start automatically.

    Click OK to save the changes.

    I would be interested in understanding why the shortcuts stopped working as this code should not have any side effects.

    David

Page 1 of 1 (7 items)
Comments Information

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.

Leave a Comment
  • Please add 6 and 6 and type the answer here:
  • Post