No PDF Attachment to Email (Bullzip PDF)

Bjorn77Bjorn77 Member Posts: 4
More and more we are having customers complaining that bullzip / BioPDF failed to attach the created PDf file to the email. The initial solution is that there is 1 codeunit who handles the whole process in one go. -> Create PDF -> Send Mail

For the NAS I have solved the problem by splitting the jobs and made two tasks. 1) Create PDF 2) Send Mail. And, gladly, this works fine. All mails send by NAS contain PDF.

But for the user driven process (Posted Sales Invoice - Mail PDF) I can not split the process, and thus sometimes the customers of our customers get an email with no PDF attachment.

If you use Bullzip and this problem does sound familiar, please give advise on how to solve this or perhaps how did you solve this?

Thanks 4 reading and maybe helping.

Comments

  • stiastastiasta Member Posts: 106
    I have gotten a similar problem using pdfcreator. Maybe my solution works for you too..
    before sending email i check if the file exists in the filepath using a while loop with a timeout.
    while not exists(filepath) do
    if timeout = 30000 then
    error(errormessage);
    timeout += 1;

    When it finds the file it continues. The file could still be unfinished so i use a method from the automation server that checks the number of documents in print queue.
    while printqueue > 0 do;

    when this line is finished there is no documents in print queue and the file should be ready. to attach to email.
  • Bjorn77Bjorn77 Member Posts: 4
    stiasta wrote:
    I have gotten a similar problem using pdfcreator. Maybe my solution works for you too..
    before sending email i check if the file exists in the filepath using a while loop with a timeout.
    while not exists(filepath) do
    if timeout = 30000 then
    error(errormessage);
    timeout += 1;

    When it finds the file it continues. The file could still be unfinished so i use a method from the automation server that checks the number of documents in print queue.
    while printqueue > 0 do;

    when this line is finished there is no documents in print queue and the file should be ready. to attach to email.

    Thank you,

    The WHILE DO I already have:

    TimeOutLInt := 0;
    WHILE NOT EXISTS(FileNameGtxt) AND (TimeOutLInt <= 10) DO BEGIN
    SLEEP(1000);
    TimeOutLInt := TimeOutLInt + 1;
    END;

    The method from the automation sounds good. Good idea!
  • stiastastiasta Member Posts: 106
    tell me if it didnt/did work :)
  • Bjorn77Bjorn77 Member Posts: 4
    stiasta wrote:
    tell me if it didnt/did work :)

    Can you specify the automation?
  • kinekine Member Posts: 12,562
    I am using another way how to detect if the file is generated and available for attaching. Try to open it for writing. If it ends with error, the process is still not finished. If you are able to open the file for writing (WRITEMODE=true) than the file is available... (of course, it expect that the user has write permissions in the folder).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • stiastastiasta Member Posts: 106
    Kines solution is not dependent on automation methods. I havent tried it myself, but it should work. :)
Sign In or Register to comment.