Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Dexterity - Cross Dictionary Trig against a sproc procedure

Posted on by Microsoft Employee

Hi,

I have written a cross dictionary trigger against a procedure in the MFG dictionary.  The procedure in the MFG dictionary calls a stored procedure.  I need to trigger off of this procedure but I cant get the cross dictionary trigger to register properly.  Here is my register code:

result = Trigger_RegisterProcedureByName(346,  "mmopAddActivityRecord", TRIGGER_AFTER_ORIGINAL, script xtrig_mmopAddActivityRecord_Post);

The result always comes back SY_Invalid_Script, meaning that it cant find the procedure or I have the wrong number of parameters.  I have double checked both. 

My question is, is it possible to trigger off of a procedure that is ultimately a sproc calling procedure?

Thanks!

Terry Blaser

*This post is locked for comments

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,926 Most Valuable Professional on at
    Re: Dexterity - Cross Dictionary Trig against a sproc procedure

    Terry

    I am not sure if the difference is DLL vs Integer or Field vs Variable.

    Glad you got it sorted.

    David

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Dexterity - Cross Dictionary Trig against a sproc procedure

    David,

    I tried your suggestion, although it did not work it did lead me to the correct answer.  After changing the trigger registration from Trigger_RegisterProcedureByName to Trigger_RegisterFunctionByName the runtime gave me a different error.  This time it gave me an Invalid Object error as opposed to an Invalid Script error.  This told me that registering it as a Procedure was at least finding the object.  This left the possibility that my parameters were incorrect.  

    On reviewing the parameters I discovered that I had changed one of the data types from a native DDL (drop down list) to an integer.  I made an assumption that DDL's actually pass Integer values and that the trigger would accept it.  I was wrong.  I ended up manually creating the fields and data types that were in the MFG dictionary for the fields that I needed.  This did the trick.  I am surprised that a DDL isn't actually passing an integer value between scripts, learn something new every day.

    Thanks for the help!

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,926 Most Valuable Professional on at
    Re: Dexterity - Cross Dictionary Trig against a sproc procedure

    Hi Terry

    If this is a call to the sproc using the sproc returns functionality, you might need to register this as a function.

    I have not got anything to test this out on.

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans