Create a button to open an existing table in a formular
Hello,
While I'm writting an order in a formular, is it possible to open another table with a button (popup) ?
And once invoice is done, how can I create a button to send by email this order to my accounts in pdf . And I want my order ref as a name of the pdf.
I'm not so fan of the scripts. I tried but it doesn't work as I want.
What's the symbol to create line breaks in script ?
Tks.
2 replies
-
Create your invoice on the Ninox print preview screen. That will be the layout that is turned into a pdf file for emailing. Attach following script to a "Email Invoice" button:
let myinvoice := importFile(this, printAndSaveRecord(this, "Name of invoice layout"), "mypdf.pdf");
sendEmail({
from: text(userEmail()),
to: text('IssueEmailto'),
subject: "Hello World!",
text: "Some text",
html: "<h1>Some Text</h1><i>With Markup</i>",
attachments :myinvoice
})
You can enter a line break in a script like this:
let t := "text in line1
text in line2";
t -
I am not sure what you are asking for in your first question, but try this. The below code shows how to copy data from one table to another table using a Table1 button script, and to open and display the results in Table2, with one click. Create tables named "Table1" and "Table2", both with a text field named "Contact". Place a button in the detail form of Table1 named "Copy from Table1 to Table2". This will demonstrate that it is "possible to open another table" with a button script:
let t2 := (create Table2);
let c := Contact;
t2.(Contact := c);
openRecord(t2);
alert("Table1 Contact " + c + " has been copied to Table2")
Note that the first line creates a record in the table (not the table).
Content aside
- 4 yrs agoLast active
- 2Replies
- 977Views