Email Attachment - Multiple Docs

Idleness
Member Posts: 46
Hi
I am auto attatching a purchase order to an email (pdf) and then attaching a separate pdf for the terms and conditions. 90% of the time this works great but every so often it fails to attach the terms and conditions (the second attachment) for certain users. Sometimes the functionality comes back and sometimes not.
The first attachment always succeeds no matter what. I am using a custom function of codeunit 397 in Navision v5.
Attachfilename is the purchase order, the second attachment is a custom field in the purchase setup. All code executes as it should, no errors even when unsuccessful. I have cleared zup files, reset exchange profiles. When it goes it is user specific but everything checks out for that user (permissions to filels etc).
Thanks for any help, it is frustrating the life out of me.
I am auto attatching a purchase order to an email (pdf) and then attaching a separate pdf for the terms and conditions. 90% of the time this works great but every so often it fails to attach the terms and conditions (the second attachment) for certain users. Sometimes the functionality comes back and sometimes not.
The first attachment always succeeds no matter what. I am using a custom function of codeunit 397 in Navision v5.
Attachfilename is the purchase order, the second attachment is a custom field in the purchase setup. All code executes as it should, no errors even when unsuccessful. I have cleared zup files, reset exchange profiles. When it goes it is user specific but everything checks out for that user (permissions to filels etc).
Thanks for any help, it is frustrating the life out of me.
IF ISCLEAR(BSTRConverterAttachFileName) THEN CREATE(BSTRConverterAttachFileName); IF AttachFileName <> '' THEN BEGIN BSTRConverterAttachFileName.ResetBSTR; BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName); OAttachments := OSendMail.Attachments; OAttachment := OAttachments.Add(BSTRConverterAttachFileName); BSTRConverterAttachFileName.ResetBSTR; BSTRConverterAttachFileName.AppendNextStringPortion(PurchSetupLcl."Purch. Terms Path"); OAttachments := OSendMail.Attachments; OAttachment := OAttachments.Add(BSTRConverterAttachFileName); END;
0
Comments
-
What program are you using to create the PDF?David Singleton0
-
I'm using bullzip but the process doesn't generate the pdf, that is done via another process. Really all I'm doing is picking up and attaching 2 files.
1 is variable (The purchase order) and this always works. The 2nd is a fixed named file. Mostly it works but when it fails there is no reason that I can see as to why. I have managed to get it going again for some users where it has failed but I don't know how I did this, it just began to work again.
There is no AV trigger or user block, the environment doesn't change.
Thanks0 -
I am doing the same thing.
I modified codeunit 397 to add a terms and conditions document. There are conditions, depending on companyname and type of transaction, so I save the name of the terms and conditions document to a variable AttachFileName2.
Then I have exactly what you have, except for the variable name instead of the file name text.
The terms and conditions documents are on a shared network drive that everyone is mapped to.
As far as I know, it works.
Why not try saving your terms and conditions file name to a variable, and use that like:
BSTRConverterAttachFileName.AppendNextStringPortion(AttachFileName2);
Just a thought.0 -
Thanks Karenh, clearly great minds think alike, or fools seldom differ - not sure which
I think I will and see how it goes. I have fixed all the problem users but only by a laborious rebuild of their roaming profile but still no errors. I'll try it and post if it fails again.
Thanks again0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions