Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Problem with cross dictionary trigger.

Posted on by Microsoft Employee

Hi all, I'm creating a custom window in GP to record additional data for Project Accounting Inventory lines.

I created a test trigger for a scrolling window on the PA_Budget_Maintenance form, just to see how cross dictionary triggers worked on scrolling windows, the trigger is below.

 

l_result = Trigger_RegisterFocusByName(258, "'PA Cost Category ID' of  window PA_Budget_Maintenance_Scroll2 of form PA_Budget_Maintenance",TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script pa_application_codes);

if l_result <> SY_NOERR then

    warning "PA User defined focus trigger failed." +str(l_result);

end if;

 

It registered fine and the trigger fired when it should have.

 

I then created the trigger below for the paBudgetIVItems form (the form we need to use)

 

l_result = Trigger_RegisterFocusByName(258, "'PA Forecast Quantity' of  window paIVItemsScroll of form paBudgetIVItems",TRIGGER_FOCUS_PRE, TRIGGER_AFTER_ORIGINAL, script pa_application_codes);

if l_result <> SY_NOERR then

    warning "PA User defined focus trigger failed." +str(l_result);

end if;

 

It registered fine but simply will not fire, I have tried loads of things, even tried a database trigger on update from the scrolling window link table but nothing.

Any ideas why it worked on the first window...but not the second?

Ian.

 

 

 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Problem with cross dictionary trigger.

    The script debugger did the trick!

    Not sure where I was going wrong, I opened the PA dictionary to find out what form paBudgetIVItems belongs to, and according to dex it was the paBudgetIVItems form, but the script debugger showed it was a window on the PA_Budget_Maintenance form…

    Sanity regained.

    Thanks a whole bunch.

    Ian.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Problem with cross dictionary trigger.

    Thanks Dave.

    I'll try working off a change etc. and see if it makes any difference. Also check the field is running.

    I'll update you if resolved.

    Best regards,

    Ian.

  • Verified answer
    Dave Dusek Profile Picture
    Dave Dusek on at
    Re: Problem with cross dictionary trigger.

    Ian,  

    If the trigger is registered, then it should definately run.  I guess I would double check and make sure that is the field that you want this script to run on.  Sometimes GP stacks fields on top of each other and displays them differently depending on conditions.  Maybe the field you are triggering on isn't actually running.  Also, you have this trigger on the field pre script.  So it will run when you tab into the field.  Are you sure that's what you want?  Or do you want a change script?  To tell what field is actually running, turn the script log on and then go through and try to make the trigger fire.  Then look at the script log and see if it is actually the 'PA Forecast Quantity' field.  

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans