Search…
Resources
Related Links
printRecord
To print to a PDF from a given record in a given layout and open the file with a program set as default
This function prints a record in a PDF and automatically downloads the PDF to your computer on which you execute the function.
The PDF name refers to the table and the record ID.
The function doesn't work if it's executed on the server. So using this function in a do as server block doesn't work. It works fine when used without a do as server block on a button. Learn more about execution context​

This function also works for Carbone templates and allows you to add optionally a JSON to overwrite the record data for the template.
Carbone templates are available on Ninox Private Cloud and On-Premises. Please get in touch with our Sales team.

printRecord(nid, string)
printRecord(nid, string, JSON)

void

printRecord(record, myLayout) To print to a PDF from a given record in a given layout or Carbone template and open the file with a program set as default.
1
printRecord(this, "Invoices")
Result: The current record will be printed as a PDF in the Invoices layout. You'll find the PDF in your Downloads.
​
printRecord(record, myLayout, data) To print to a PDF from a given record in a given Carbone template and open the file with a program set as default. Record data can be overwritten with a JSON object.
1
printRecord(this, "Invoices", {
2
Date: format(if Date = null then Date else today() ,"MM/DD/YYYY")
3
})
Result: The current record will be printed as a PDF in the Invoices layout. You'll find the PDF in your Downloads. If there is no entry in the Date field, Today's date, for example, 08/28/2022 on August 28, 2022.

​printAndSaveRecord, which saves a given record in a given layout as a PDF in the internal file system and returns a link to the file.
Export as PDF
Copy link
On this page
Syntax
Return
Examples
See also