I have a problem, when running a report from the OnModify trigger of a table.
The situation is: when a record changes i need to send a notyfication e-mail. The attachment is a html file generated by a report.
When I run a report (SAVEASHTML) from the OnModify trigger, it seems, that the report runs the OnModify trigger of the table, and falls is recursion.
I tried it on several tables/reports.
Has anybody met this problem?
0
Answers
Other things: SQL2005, and NAV400 without any SP.
I just tried to save a report as htlm from the OnModify trigger and my computer locked up. It took my 5-10 minutes to kill Navision.
I don't know what is happening and I won't repeat the test
I guess we can conclude that we shouldn’t try to save reports as html from the OnModify trigger. Have you tried to solve the issue differently?
You could just send a email from the OnModify trigger and then link to the report or include the required information in the body of the email.
Regards
Claus
http://www.AcumenConsulting.co.nz
Anybody else can solve this problem?
Before running the modify(true) statement call the function.
In onmodify trigger run the report only if DONNOTSENDREPORT is set to false.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
My last try was:
ReportSended: Boolean (Global scope)
OnModifyRecord trigger of the form (SourceTable: T5050 (Contact)):
run the report if the ReportSended is FALSE, and set it TRUE.
And what i thought is impossible: it falls in recursion too. It seems, that the report runs this trigger too, and the "IF NOT ReportSended THEN" takes no effect... :?:
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
thx
Added a new Field in the T5050 (Contact) Notification Sent - Boolean
Created a report (Contact - Card), in the OnAfterGetRecord trigger: Added a new function - NotifyByMail to the T5050:
In the OnModify trigger of the table:
Thanks all!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n