web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Capture Delete event for Item Class

(0) ShareShare
ReportReport
Posted on by 121

I can successfully capture when a new Item Class is created and retrieve the Item Class Code and Description

public void Initialize()
{
    Dynamics.Forms.IvClassMaintenance.IvClassMaintenance.SaveRecord.Change += new EventHandler(SaveRecord_Change);
}

public void SaveRecord_Change
{
    var code = Dynamics.Forms.IvClassMaintenance.IvClassMaintenance.ItemClassCode;
    var desc = Dynamics.Forms.IvClassMaintenance.IvClassMaintenance.ItemClassDescription;

if (Dynamics.Forms.IvClassMaintenance.IvClassMaintenance.IsChanged && !String.IsNullOrWhiteSpace(code))
{
// Do something...
} }

I considered attaching an event handler to one of the DeleteButton events, but this does not apply in all instances (for example when someone presses the Delete button and then Cancel.)

Dynamics.Forms.IvClassMaintenance.IvClassMaintenance.DeleteButton.ClickAfterOriginal += new EventHandler(DeleteButton_ClickAfterOriginal);

Should there be a "DeleteRecord" event that I am missing here??

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: Capture Delete event for Item Class

    Check this link.

    https://community.dynamics.com/gp/b/anotherblogaboutdynamicsgp/archive/2017/04/24/vstools-and-database-triggers

  • Community Member Profile Picture
    on at
    RE: Capture Delete event for Item Class

    In VSTL you can register trigger against a procedure. In dexterity we have database triggers. You can do small coding in dexterity and create a custom procedure in dexterity. Then in dexterity again using database triggers you call the same (new) procedure every time. Then register the trigger in VSTL against that new procedure. By this means you can get triggers in VSTL similar to that of dexterity database triggers. You can also pass parameters to new procedure in dexterity and access them in VSTL. Hope this helps.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans