I would like a report that runs thru some "selected" orders - sends a "Sales Confirmation Email"
then deletes the order.
The email is easily sent but I cannot delete the order. Apparently when the email is sent a field
called E-Mail Notification Handled (boolean) is update. So when I go to delete the order it says
"Another user has modified this Sales Header after you have retrieved it from the database"
"Enter your changes again in the updated window, or start the interupped activity again"
"Identification Fields & Values"
Document Type='Order',No.='1234567'
OnAfterGetRecord()
SendNotificationEmail;
DeleteOrder;
SendNotificationEmail()
emailmgt.SendSalesConfirmation("Sales Header",TRUE);
DeleteOrder()
"Sales Header".DELETE;
Anyways around this? I would like to mass notify & delete selected orders that we will not ship. doing 100's one at a time sucks. I guess I could call another report that does the deleting :-k
Comments
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I'll mark it as solved because that does work. Hate to use two report up
http://www.BiloBeauty.com
http://www.autismspeaks.org
A pack of 100 report is very economical considering what you're getting out of Navision.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
SendNotificationEmail()
emailmgt.SendSalesConfirmation("Sales Header",TRUE);
CallbyValue or CallbyReference (Flag VAR)?
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
I was wondering why you doesn't make a "Sales Header".delete(true);, but i didn't say anything because i thought it was not the whole code (sorry) and you delete the other tables some lines later ....
Regards
René
create a boolean in the sales line table - if header exists, took 2 seconds.
Selected all that said no & & deleted them - then removed the field.
Thanks for your input!
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
Just for future reference, if you use "Sales Header".DELETE( TRUE ); -it will run the code in the ondelete trigger of the sales header table which delete the sales lines and all depending tables.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
http://www.BiloBeauty.com
http://www.autismspeaks.org