Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Capture Delete event for Item Class

Posted on by 115

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

  • Community Member Profile Picture
    Community Member Microsoft Employee 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.

  • Verified answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at

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