0

Problem with creating PDF after update

Hello Everyone

 

I need your help, because the only answer, that I am receiving from Ninox is - take a part in our Webinar!

 

I have the following problem - my system is working already more than two years.

I have "learn" the code by my self - never have a real time to study it.

I have create my system, but was not so good to set my mail.

That's why I have used a ready decision from here - the forum.

And it was working - till the last Ninox update.

Aftre that I start to receive error messages.

The explanation from Ninox was, that till now the system wasn't care about the errors and was working, and now - it is, and that's why is not working anymore.

The code, that I am using is

'Send KBU' := color("green");
let myEmail := userEmail();
let myPdf := printAndSaveRecord(this, "Quotes");
let myName := Date + text("_MA") + 'Auftrag Nummer / Order' + text("_") + AuftragTable.'Techniker 1'.Nachname + ".pdf";
importFile(this, myPdf, myName);
sendEmail({
    from: userEmail(),
    to: "george.tanev@bullmer.de",
    subject: text("Reparaturauftrag von Fa.") + text(" ") + AuftragTable.Kunde.Kunde2,
    text: "Hallo 

Das ist der Reparaturauftrag von " + Techniker + text(" für Fa. ") + AuftragTable.Kunde.Kunde2 + "
        

" + Komment + "
    

Mit freundlichen Grüßen / Kind regards

Service

",
    attachments: file(this, myName)
});
closeAllRecords()

 

As far, as I have understand, the problem is in the date format and the Quotes, but I can't find a working solution.

Thelast one is 

let me := this;
do as server
    let myEmail := userEmail();
    let myLayout := "Service report";
    let myPdf := printAndSaveRecord(this, "Service report");
    let myName := text("_MA") + 'Auftrag Nummer / Order' + text("_") + AuftragTable.'Techniker 1'.Nachname + ".pdf";
    importFile(me, myPdf, myName);
    sendEmail({
        from: userEmail(),
        to: "george.tanev@bullmer.de",
        subject: text("Reparaturauftrag von Fa.") + text(" ") + AuftragTable.Kunde.Kunde2,
        text: "Hallo 

Das ist der Reparaturauftrag von " + Techniker + text(" für Fa. ") + AuftragTable.Kunde.Kunde2 + "
        

" + Komment + "
    

Mit freundlichen Grüßen / Kind regards

Service

",
        attachments: file(this, myName)
    });
    'Send KBU' := color("green");
    closeAllRecords()
end

I ca send it - no errors, but I am receiving nothing!!!

I need urgent help about that - my system is not functioning correctly more than a week!

3 replies

null
    • mpm
    • 2 yrs ago
    • Reported - view

    Hi,

    I cannot help you find the answer but I have issues with creating pdf in general. The code importFile(this, printAndSaveRecord(this,"Name") doesn't seem to work properly anymore. So it might just be an issue concerning that function?

      • George_Tanev
      • 2 yrs ago
      • Reported - view

      mpm It works - I have find my solution by my self.

      This is part from my code

      let me := this;

      let myName := Date + text("_MA") + 'Auftrag Nummer / Order' + text("_") + AuftragTable.'Techniker 1'.Nachname + ".pdf"; This is the name, that I want to give to my PDF
      printAndSaveRecord(this, "ServiceReportTable") - You have to specify where he has to save the PDF. For example - when you push the print button in your Table, you will seeyour Template (how the PDF will looks like). In the upper right corner you will see the name of your Template. Use the same name - in my case this is "ServiceReportTable"

      • mpm
      • 2 yrs ago
      • Reported - view

      George Tanev Thank you. That helped!

      Now I got:

      if 'Sessie code' = 0 then
          let myName := "Verslag intake " + ID + ".pdf";
          importFile(this, printAndSaveRecord(this, "Sessies"), myName)
      else
          let myName := "Verslag " + ID + "-" + 'S-nr' + ".pdf";
          importFile(this, printAndSaveRecord(this, "Sessies"), myName)
      end

      Everything is working fine again 🙂 thanx again

Content aside

  • 2 yrs agoLast active
  • 3Replies
  • 118Views
  • 2 Following