Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How we fire conditional trigger, particular event is fire then run our script

(0) ShareShare
ReportReport
Posted on by 617

Hi All,

Actually when i customize the customer option sub form of customer master. I need that when i close the customer master without save show a popup        Save      Discard    Cancel        SO i want to fire my script when i click the Discard. 

So please any one can know that how can i solve this situation.

Thanks & Regards,

Govind Devda

*This post is locked for comments

  • Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    great, now you can verify your question!

  • GovindDevda Profile Picture
    617 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Hey Soma & Almas really thanks for reply Problem is solve out .

    ->As your suggestion , i  use dexterity database triggers on save record of customer master, and use temp table also on "OK " button of Customer Options, because we need to display temp record which still not save.

    Again thanks to all for guide me.

    Thanks & Regards,

    Govind Devda

  • Verified answer
    soma Profile Picture
    24,410 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Yes. I agree with Almas. You can also do the same by writing dexterity database triggers.

    Hope this helps!!!

  • Verified answer
    Almas Mahfooz Profile Picture
    11,009 User Group Leader on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    To achieve the particular need, process is lengthy and needs a more line of code and checking.

    I advise you to use database trigger instead of focus trigger, means if your objective is to save/delete/edit data in your table when record gets saved in GP table then database trigger is the best.

  • Suggested answer
    soma Profile Picture
    24,410 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    As I told earlier, this is very tough task.

    Better add one more condition like delete your customize data into your table if the customer record not available in Customer Master tables. Means, if you click discard your script should run and delete your data if the customer id not in Customer Master table. Similarly your discard script will run while clicking save, but here your data won't delete if the customer id available in Customer Master table.

    Note: Do the multiple unit test with different scenario.

    Hope this helps!!!

  • GovindDevda Profile Picture
    617 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Hey Soma thanks for reply , actually same problem i have face i have try DiscardEmailAddresses  but when i try to click on save button then again fire this scrpit means that both discard and save case run this script.and i want to run my script only discard case. is any alternate solution.

    Actually i have customize Customer option and i was write a trigger on Startup save record on 'Ok ' button.

    But some cases we don't want to save customer master then direct close in that case message popup  if we discard then i want to delete my customize data into our table.

    Is any alternate solution to solve this problem.

    Thanks & Regards,

    Govind Devda

  • Suggested answer
    soma Profile Picture
    24,410 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    This is very difficult. Each window having certain logic. But, based on my analysis I have found one script from customer maintenance window.

    Write a after original trigger for below script and try the same.

    DiscardEmailAddresses of form RM_Customer_Maintenance

    Note: But, the above script also will run for window close discard, clear, delete, next,prev records and some other places.

    Hope this helps!!!

  • Mahmoud Saadi Profile Picture
    32,738 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Have you seen Dexterity Focus Triggers in Dynamics GP ?

  • GovindDevda Profile Picture
    617 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Hey Mahmoud  thanks for reply but i want to implement in dexterity code actually  i am not using VS tool only using the Dexterity.

    Thanks & Reagrds

    Govind Devda

  • Suggested answer
    Mahmoud Saadi Profile Picture
    32,738 on at
    RE: How we fire conditional trigger, particular event is fire then run our script

    Hello GovindDevda 

    There is an old article by David Musgrave on a similar issue; Capturing the Save Event with Visual Studio Tools

    Take a look at it,

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans