0

Print

Hi, i maked button in form of invoice items, then when i changed  a goods i click print form and i can see in attach. Problem is when i change for example items and will print againe , in attach replace to my print. I will when push button for print to attach dont replace. Continue to add file. More add file;

15 replies

null
    • New_Sun
    • 6 yrs ago
    • Reported - view

    did you notice that i mean?

    • Support
    • 6 yrs ago
    • Reported - view

    Hi, 

    if you add to the filenam "mypdf.pfd" a timestam like:

     

    now() + "mypdf.pdf"

     

    it will not replace the already existing files, because every file get a new name.

    Best, Jörg

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Dont worked

    • Support
    • 6 yrs ago
    • Reported - view

    How did you try it? Can I see your formula please?

    • New_Sun
    • 6 yrs ago
    • Reported - view

    importFile(this, printAndSaveRecord(this, "'Invoice Items'"),now()+ "mypdf.pdf")

    • Sean
    • 6 yrs ago
    • Reported - view

    The problem is the "/" generated by the now() function. You can use the format function to remove the "/". This is what I did and it worked correctly.

     

    let txtPDFName := format(now(), "MM-DD-YYYY") + " mypdf.pdf";
    importFile(this, printAndSaveRecord(this, "Table2"), txtPDFName)

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Thank you, your formula working but problem is when i push button , then Replaces the previous one. Dont add to Add file. I want to get sequential prints. For example 3 or 4 print and see all

    • Sean
    • 6 yrs ago
    • Reported - view

    It turns out that ":" is also a problem. You can use now() so a new document is produced each time, but you have to replace "/" and ":". This is how I did it.

     

    let txtNow := text(now());
    let txtReplace1 := replace(txtNow, "/", "-");
    let txtReplace2 := replace(txtReplace1, ":", "-");
    let txtPDFName := txtReplace2 + " mypdf.pdf";
    importFile(this, printAndSaveRecord(this, "Table2"), txtPDFName)

     

    You can use a different symbol than "-". I used it as an example because I know it works.

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Replaces the previous one too againe

    • Sean
    • 6 yrs ago
    • Reported - view

    I'm using the now() function because that was the original solution. I would probably use a different auto increment scheme, but I'll stick with now(). This should work.

     

    let txtNow := format(now(), "MM-DD-YYYY HH-mm-ss");
    let txtPDFName := txtNow + " mypdf.pdf";
    importFile(this, printAndSaveRecord(this, "Table2"), txtPDFName)

     

    This actually simpifies it a little bit.

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Great!  Worked. Many thank you.

    • Sean
    • 6 yrs ago
    • Reported - view

    Another option for now() is this.

     

    let txtNow := text(number(now()));

     

    It will generate a file name like this... 1540416426537 mypdf.pdf

    • Sakshi_Singh
    • 6 yrs ago
    • Reported - view

    Hi,

    Files can also be numbered sequentially,

     

    let n := count(files(this));
    let attName := "Invoice " + n + ".pdf";
    importFile(this, printAndSaveRecord(this, "Invoice"), attName)

     

    Regards,

    Sakshi- Ninox

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Thank you, 

    • New_Sun
    • 6 yrs ago
    • Reported - view

    Sakshi, your fomula is good because show no invoice and this is good for me. Thank you

Content aside

  • 6 yrs agoLast active
  • 15Replies
  • 3926Views