Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Pre/Post Stored Procedures

Posted on by 190

When upgrading to a new version of GP...If a stored proc in the business object is updated with a new parameter (thus also updating the pre/post stored proc parameters)...will our custom code in the pre/post stored proc be carried over?

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    [quote user="ausomecasey"]will our custom code in the pre/post stored proc be carried over?[/quote]

    Hi Casey,

    All pre and post stored procedures are dropped and re-created automatically during the upgrade process - this means you will lose all the custom logic inside them.

    Copy and paste the logic only (leave the parameters alone) from your old version to the logic section of the new pre/post proc (again - leave the parameters alone).

    Thanks,

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    Why don't you take any econnect Stored procedures as an example?  Make custom changes in the triggers and Do a GP upgrade.  After the upgrade check the trigger.

  • soma Profile Picture
    soma 24,406 on at
    RE: Pre/Post Stored Procedures

    Could you post any sample script for your SQL trigger?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    @Soma If we restore the original trigger after GP upgrade, it will undo the changes done by GP upgrade.  In that case You will have the old parameter in the stored procedure which is incorrect, also GP application code and stored procedure wouldn't match with parameters.  Thoughts?

  • soma Profile Picture
    soma 24,406 on at
    RE: Pre/Post Stored Procedures

    Yes. But, you need to backup and restore your triggers once you upgraded.

    Hope this helps!!!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    Hi Soma, Are you saying that pre/post stored procedure will work after upgrade in case of any change in parameter?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    Hi Casey,

    The answer is No. It will be gone, unless you have a backup or save it in a different name.  After upgrade, you have to manually copy your custom code to the stored procedures.

    Hope it helps.

    Thanks,

    Shan

  • soma Profile Picture
    soma 24,406 on at
    RE: Pre/Post Stored Procedures

    The stored procedure triggers are fire based on name of the stored procedures used inside your triggers. It wont consider any parameter or other changes inside the stored procedure. So, I think your triggers will be work without any problems.

    Hope this helps!!!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Pre/Post Stored Procedures

    Hi, as far as I know every time when there is an upgrade these store procs are created unless you have renamed them to a different name.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans