#Dexterity Script Editor Undocumented Features: Snippets and Auto Close

David Meego - Click for blog homepageA recent Microsoft Dynamics GP forum post reminded me to create an article about a couple of cool, undocumented features available for the Dexterity Script Editor.

The request was for an easy method of inserting a script header comment block into new scripts. I have seen some developers modify/hack the DEX.DIC with Dexterity to produce similar custom functionality, but there is built in functionality you can enable instead.

The two features I want to discuss are enabled using Dex.ini settings and are described below:

EnableSnippets=TRUE

Dexterity has a hidden Snippets feature!

Yep, thanks to Patrick Roth (ex Great Plains/Microsoft, now at eOne) there is a Snippets feature in Dexterity. I am not sure what version it was added, but it was never publicized (until now … even though I have mentioned it in a conference session previously).

Once the Dex.ini setting is added and the feature enabled, you will find a Snippets button appears on the top right of the Resource Explorer.

Clicking on this button opens the Snippet List window, from which you can maintain your Snippets. You can create New Snippets, Copy an existing Snippet, open Snippets for Editing, or Delete Snippets.

Double clicking on a Snippet also opens it for Editing. The Snippet Maintenance window is used to define the Snippet. The Menu Heading and Snippet Description is what is used to select the Snippet in the Script Editor, this allows Snippets to be grouped into menus.

You can also export and import Snippets as *.snippet or *.txt files using the buttons on the top right of the window.

Once you have all your Snippets defined, they will be available from the Script Editor to the right of the References button.

The Snippet Data is stored in a local Ctree table stored in the Data folder (Snippets.dat and Snippets.idx). These files can be copied between development environments and probably should also be backed up.

CloseOnCompile=TRUE

When most Dexterity Developers have finished working on a script, they click on the Compile Button immediately followed by the Close Button. When the above setting is enabled, clicking on the Compile Button alone will automatically close the script editor.

Hope you find these little gems useful.

David

PS: Subscribe to the blog to get more of these little nuggets. 😁

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

9 thoughts on “#Dexterity Script Editor Undocumented Features: Snippets and Auto Close

    • The issue is I have not been able to present another 25 tips and tricks session at a GP Tech conference for 3 plus years. So they have been sitting waiting. I will publish some more stuff once I work out the best ways to use it.

      Like

  1. Wow, I don’t remember anymore when I added that. I did pretty much the same thing that David described – except I had source code for the Dex.Dic at that time.

    I was doing so many customizations at the time that it was annoying to copy & paste the trigger registration script from Dex help that I thought “if we only had code snippets like VS does”.

    So I modified the Dex.dic to add the functionality. After doing that for a few versions – I got tired of having to recreate my changes and so I begged the Dex dev team to add them into the product as a “secret ini switch” and they did somewhere along the line.

    My only regret and what annoyed me after it got added into the dictionary is that I wish I would have made the code snippets size much larger than I did – I _think_ I had made it 500 chars which isn’t all that much. But it was enough to put in my trigger registration scripts which made me happy (for the most part).

    Like

  2. David, I have a question that I cannot find an answer for and with your knowledge I am sure you can answer in ten seconds or less. ListObj_Customers is the card list used to display the customer list in Dynamics. Can I copy this object and all it’s scripts so that I can modify them to display more columns in the output? Basically the credit limit column would be really useful on this list and I wish to add it! I’ve scoured the forums for days trying to find an answer which still eludes me!

    Like

    • Hi Sean. No, you cannot copy a form and edit it. Even if you had source code, it is not best practice and is very evil.

      But. You can use triggers to change the navigation lists. I think this is covered in the Integration Guide (IG.PDF) installed with Dexterity.

      David

      Like

      • Hi David, It appears you can add columns to smartlists with triggers but nothing in the integration guide regarding triggers to add columns to navigation lists. It’s a shame that more columns are not available in this list, I can see from the tables that credit limit is available in the data set. It seems odd that this column is not available! I’ll have to build a new customer list with that one extra field 🙂

        Like

      • Hi Sean

        Did you look at Chapter 30: Card Lists in the IG.PDF. Surely you could trigger on and/or call the core functions used to define the columns and change the behavior to add an additional column to the existing list.

        David

        Like

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.