web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

#GPPT GP Power Tools - Using Global varialbes in another dictionary

(0) ShareShare
ReportReport
Posted on by 5

Hi folks, 

Hoping this is an easy one and i'm just being a bit thick.  I have created a trigger script on a window (modified) which resides in a custom dictionary (created by our partner).  While doing this i found the need to use a global variable from the main Microsoft Dynamics GP dictionary, which i inserted to my trigger script using the Names > Global Variables menu.  Problem is, when I try to save the script it doesn't like it.  Comes up with a very unhelpful error about a custom field i added to the window (it has a value assigned to it much further down in the script) but as soon as i comment out the global variable it saves and runs perfectly, including assigning the variable to my custom field.

On the 'Resource' tab i have the custom dictionery and have ticked 'modified'

Nothing ticked on the 'Actions' tab

On the Script' tab i have select the custom dictionery and ticked 'modified' under 'Script and Context'

Heres a snippet of code showing my variable and the attempt to assign the global 'Intercomany ID' value :

pastedimage1683274447587v2.png

and the error i receive :

pastedimage1683273809706v1.png

Validity is the custom field I added to the window.

I have worked around this using a very cludgey "select DB_NAME()" style sql statement to get the database ID i need but its so....inelegant.

So I guess my question is - can i add these global variables when using a custom dictionary?  and if so, how? 

If its normally possible and should be working then i'm obviously doing something wrong and that fine,  i'll figure it out.  I just want to know if i'm banging my head against a wall for nothing!

Please point out if i'm missing any critical information.

Thanks in advance for any assistance.

P.S. if theres a better place to be asking question about GPPT please also point that out to me, i'm a bit new at this!

Categories:
I have the same question (0)
  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    Hi

    Support for GP Power Tools is best handled via the support request form on our website.

    Anyhow, use the Helpers button and there is a section for Constants and Globals.

    There are 100s of helper functions that can achieve many functions not possible with standard Dexterity code.

    Also make sure you are using the latest build 29.4 code as it has fixes worth having.

    Regards

    David

  • WanderingBadger Profile Picture
    5 on at

    sigh... of course I should have used the helper function for the constant.  i've used them for all the other form fields that were being awkward, it should have occurred to me.  

    Appreciate the reply and that did indeed fix the issue!

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    Great news.

    Make sure you look at all the samples on the GP Power Tools portal samples page:

    winthropdc.com/.../Samples

    Especially the "Must Have" examples such as SQL Search Lookups and change tracking for customers, vendors and items.

    Regards

    David 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 471 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 423 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans