Paramater Setup

Configuration

Both the Deployment record and some of the workflow actions share the same parameters in their configuration. This chapter will describe how the configuration should be made. The parameters can be divided into three groups that are covered in their own separate section:

  • Emailing fields

  • Value fields

  • PDF File settings

This chapter will also include some different examples of workflow action configurations.

Emailing fields

For PDF documents that you want to email as attachments, there are some settings that can be done in NetSuite to make the sendout more easy and efficient. Please note that you can choose to deploy your created layouts from either the deployment record (child-record to the Layout Builder) or using the workflow action scripts included in the bundle. Read more about these two options and their pros and cons here.

The below paramaters can be configured:

  • Default Value For Send To: List/record field of Entities.

  • Default Value For Recipient: Email address field sourced from "Default Value for Send To" field.

  • Default Value for CC: Free-Form Text field to support inclusion of multiple email addresses. Multiple email addresses should be separated with comma ( , ) .

  • Default Value for BCC: Free-Form Text field to support inclusion of multiple email addresses. Multiple email addresses should be separated with comma ( , ) .

  • Default Subject: Free-Form Text field. The subject of the email. Can be fetched from a field or hard-coded in configuration.

  • Default Message: Rich Text field. Will be used as the email body. Can be fetched from a field or from an HTML file stored in the file cabinet.

  • Author: List/record field of Employees. Must be an employee. To use a generic author you can create an employee record with the name and email address. Login access is not necessary.

  • Send Direct: Check Box field. When ticked in the configuration, an email will be sent directly without displaying the Order Printout-form. Useful when scheduling reports using workflow for example.

If you wish to fetch the email body from an HTML file stored in the file cabinet, the configuration should be as in the image above. The "lookupfile:" should be followed by the internal ID of the file.

Values included in your dataset can be available and referenced in the HTML-file when using lookup_file (e.g. ${BaseRecord.custrecord_my_field}. Please note however that this cannot be combined when the Send Direct option. When using Send Direct you need to use the standard way of referencing fields from your record (e.g. ${customrecord.custrecord_my_field}).

Attach Files

If you want to include attachments to your email in addition to the PDF created from your layout, you can use the Attach Files parameter field available in the Order PDF workflow action. Youi can choose to add one or several files separated by comma. There are three different ways of fetching the files:

  1. Hard-corded internal ID of the file you wish to add (e.g. 16190 as in the below example)

  2. From a field on your report's base record. Fetch the the field key using Visualize data and paste it to the field. (e.g. ${BaseRecord.custrecord_sclun_pdf_in_field@id}. In this case we add the suffix @id since this field is a document field and we want the internal id of the file and not the file's name (which we would get without the suffix). The field can also be a textual field but then it must contain the internal id of the file you wish to add.

  3. You can also add a Value typed dataset and store the internal id of the file in that field. (e.g. ${IncludedPDF}). This key can also be copied directly from your layout and the Visualize data.

If you want to combine multiple files it could look something like this: 16190,${IncludedPDF},${BaseRecord.custrecord_sclun_pdf_in_field@id}

Value fields (Layout Fields)

  • If you add Value fields in your datasets, those fields will be displayed in the Layout Parameters section in the Order printout form.

  • Read chapter Value Fields for more information about value fields, the different types available and how to use them within your created layouts.

  • If you deploy your layout using workflow you can configure default values for the value fields in your workflow setup. In the field Layout Fields you can insert a JSON object with the fields and the default value that you would like to fill in.

  • Syntax: {fieldid:value}

    • Usa comma ( , ) if you want to add multiple fields. Please note fieldids are always strings ("") and that check box are interpreted as booleans and not strings.

  • Some examples:

    • {"CheckBox":true}

    • {"FreeFormText":"string"}

    • {"DateField":"2021-01-01","CheckBox":true}

PDF file settings

Attach Created PDF to Current Record

If you want the created PDF file to be attached to your current record and found under the subtab Files, tick this check box in the workflow configuration. This setting is set to yes by default. If you change this check box to false, the files are still created but you cannot access them from the Files sublist on your record.

PDF Available Online

On all files in NetSuite, there is a check box called "Available Without Login". If you want your created PDF file to have the check box ticked automatically, you can tick the below workflow parameter in your workflow configuration. This check box is set to false as a default.

Override PDF Folder

For all your created layouts, there is a default folder defined on the Layout Builder record under Settings. However, in your workflow it is possible to override that setting for your specific workflow. In the below example we are using a Value Field from our base record which contains an internal id of a folder in our file cabinet.

Alternatively if we do not have field with the information we can hard-code the internal id directly in the workflow configuration by entering the number in the Value column.

If you do not want to use another folder than the one configured on the Layout Builder record, leave this configuration line empty.

Our Custom field field containing the folder id

Configuration when using hard-coded value in workflow

Save File ID to Field On Record

If you want to store the created PDF in a field, e.g. a Document field, on your current record or a specific record you can use the Save File ID to Field On Record parameter in the workflow configuration. This record can be configured in two different ways depending on on which record you want to save the reference to the file.

Current record: If you have a field on your current record you can add the below string in the Value column to store the file's id.

For example: {CurrentRecordType,CurrentRecordID,custrecord_sclun_pdf_in_field}

Specific record: If you instead want to store your file id on a specific record you can replace CurrentRecordType and CurrentRecordID with the ids that you want to use.

For example: {customrecord_sclun_unit_test,1,custrecord_sclun_pdf_in_field_2}


Please note that you can store the file Id on text-fields such as free-form text as well as storing the PDF file in a document type field.