Microsoft Dynamics NAV crashes with finsql.exe error

Dear ALL,

I hope I am posting in the right forum :slight_smile:

I am using Microsoft Dynamics NAV 2009 R2 build 6.00.32012.

My problem appear when I added a new function for sending an email every time one customer record is changed. I use codeunit 400 to prepare and send the email.

This function is launched in the OnModify trigger. When changing an input, the NAV classic client crashes and the event log reports a finsql.exe error.

I don’t know if this error is due to the code added or my finsql.exe file is damaged !!

Thank You for your help

Hi Ines,

you might want to try the following:

Create a new codeunit, or a new function in an existing one, and trigger off the e-mail from there.
Could be that NAV is still processing the Modification which conflicts with the e-mail handling.
Option 2 is to programm a “Modify” in the OnModify Trigger and send the e-mail after that command.

And another option is to trigger the e-mail from the page / form that a user uses.

Let me know if one of my options helped you

Ernst

Hello Ernst,

Thank you for your reply :slight_smile:

I have already create a separate function in a customized codeunit to create and send the email.

The email is triggered from the form used by the user.

Concerning option 2, I didn’t understand how to program “Modify” ! Could you please give me more clarifications ?

Thank You

Hi Ines,

sometimes it works if you programm MODIFY in a trigger (that’s the command). The records is saved at that point.

If you trigger the mail from the form (and that causes a crash), my next try would be to put that in the OnModify trigger of the table.

Ernst

I moved the code in the OnModify trigger of the table and added the commande “MODIFY” before the invoke of the function.

I added a message at the end of the function indicating that the email was sent successfully.

Everything works fine for now, hopefully forever :slight_smile:

Thank You Ernst, you juste save my day.

You are welcome