Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Rollback a GP Procedure

Posted on by 88

Good Morning,

I'm asking about the GP procedures with which it is possible to develop wrappers to, for example, combine customers.  My question is whether it is possible to control transaction handling of the GP procedure via the wrapper?  So, if I wanted to test something I could rollback the changes after verifying the logic was working correctly.  Thank you.

Categories:
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,928 Most Valuable Professional on at
    RE: Rollback a GP Procedure

    Awesome. Well done.

  • NCOPP Profile Picture
    NCOPP 88 on at
    RE: Rollback a GP Procedure

    Hi David.

    Thanks for the response. Actually, I was able to determine that the GP procedure I was wrapping did in fact look at @@TRANCOUNT to determine whether it should execute within or create its own transaction.

    I thought it was not working because I forgot that there are fixed length char fields in GP. As a result when I tested the rollback and expected to see data, I was not seeing it.  It is working well.

    Thank you!

    - Nick

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,928 Most Valuable Professional on at
    RE: Rollback a GP Procedure

    You can trigger before and after a procedure.

    You can start a SQL transaction before and ask to commit or rollback afterwards.

    It would depend on how the code in the procedure is written, specifically whether it creates a new SQL connection or uses the existing one.

    So in theory it is possible, but would need to be tested to see it works.

    It would need either Dexterity or GP Power Tools developer tools to achieve it.

    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

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

Product updates

Dynamics 365 release plans