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 :
Microsoft Dynamics SL (Archived)

How to catch Cancel Event?

(0) ShareShare
ReportReport
Posted on by 47

Hi

I have a custom screen i Dynamics SL where I customize it in Visual Studio

I would please like to find out if there is a way to catch the cancel event of the built in message screen. For instance when I create a batch it pops up a screen showing the batch being created with a cancel button on it and later also shows when the batch has been created successfully. I am trying to achieve a sort of a roll back action, sometime when a user cancels the batch creation there is uncompleted entries in the database so I would like to catch that event of that cancel button so I can try and write code to prevent redundant data. 

Please Advise 

Regards, Lee'Roy Gerber

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Apps Mexico Profile Picture
    1,090 on at

    Hi,

    The event that trigger when you press the cancel button or the ESC key is 

    Private Sub Update1_CancelEvent(ByVal Level As Short, ByRef RetVal As Short) Handles Update1.CancelEvent

    End Sub

  • FATSN00 Profile Picture
    47 on at

    Hi Juan

    Thanks for the reply! I have another question for you in connection with this. We have a custom exe in Dynamics SL which creates a batch. Upon clicking the begin processing button it starts to create the batch in the db. Our problem is sometimes half way through the batch creating process you can get that a user pushes the cancel button the message box cause a uncompleted batch to be written to the db and will thus not balance. Is there or do you know of a way where I can apply a sort of roll back action which rolls back the batch creation or deletes the uncompleted batch data within the db when clicking the cancel button?

    Please advise me on this thank you

    Regards,

    Lee'Roy

  • Apps Mexico Profile Picture
    1,090 on at

    Maybe, if you use the Call Tranbeg(true), tranend() and tranabort functions, you could achive that. But I preferd do that kind of process on a store procedure and handle the transactions on it.

    If you couln't fix that and are interested i have many store procedures to create any kind of batches, and could give you a quote of a process that you need.

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 > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans