The following set of instructions shows how to create a PDF file that can be called with a click of a button. A button is first added to a form. Clicking the button retrieves the necessary data from the current record and creates a PDF file. The created PDF file will then be shown by using a Suitelet.
1. Create a Suitelet with the following code. This will create the PDF file using nlapiXMLToPDF in conjunction with Big Faceless Organization (BFO). Note that the internal id of the current record that is passed as a parameter will be used to load the record.
Suitelet Script Deployment:
Client Script Deployment:
3. Create a User Event script that will add a custom Button on a form. This will be triggered on Before Load function. Note that the function name of the Client script is specified. The Client script is then set using "setScript".
User Event Script Deployment:
On load of the Purchase Order record, the button "Print Item Barcode" is immediately displayed. Clicking this button will generate the PDF file which contains all the Items contained under the Items tab > Items subtab. The PDF file will display 5 columns which are Item, Rate, Barcode, Quantity and Amount.
1. View a Purchase Order
2. Click the button "Print Item Barcode"
3. A window opens containing the PDF file that was generated. It contains the data from Items on the Purchase Order record
No comments:
Post a Comment