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
-
did you notice that i mean?
-
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
-
Dont worked
-
How did you try it? Can I see your formula please?
-
importFile(this, printAndSaveRecord(this, "'Invoice Items'"),now()+ "mypdf.pdf")
-
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) -
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
-
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.
-
Replaces the previous one too againe
-
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.
-
Great! Worked. Many thank you.
-
Another option for now() is this.
let txtNow := text(number(now()));
It will generate a file name like this... 1540416426537 mypdf.pdf
-
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
-
Thank you,
-
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