Custom Fields: Special Control Types include configuration options specific to each control type in SmartSimple. Look up the settings available for the Special - Browser Script, Special - Button, and Special - Web Page View control types when building a custom field.
Special - Browser Script Custom Field
A Special - Browser Script custom field adds JavaScript to the page on which it is located, and the script executes according to its Trigger Type. Programmers use this control type to create enhanced functionality. Place browser scripts at the end of the page, sequentially after the other custom fields.
Field Display
This field displays only when the Trigger Type is set to On Demand.
Trigger Type
The Trigger Type setting is unique to Special - Browser Script custom field and works in conjunction with System Calls.
| Trigger Type | Description |
|---|---|
| On Page | The JavaScript defined in the Custom Script section loads, and functions defined in it can be called by other fields on the page. |
| On Demand | The server executes the JavaScript or System Call when the user clicks a button on the page. The button displays for the field when this trigger type is selected. Only Special - Browser Script custom fields set to On Demand have visibility on a page. Selecting On Demand displays additional settings: Show Button in Footer, Button Label, Show in View mode, Caption Location, SmartField View, and Tool Tip. |
| On Load | Only System Calls work with this trigger type. The System Call processes server-side when the page is requested. |
| On Save | Only System Calls work with this trigger type. The System Call processes server-side when the page is saved. |
| Custom Script | Stores the procedure to execute. |
Field Permissions
Role field permissions control which roles can view or modify the custom field. Status field permissions control whether the custom field can be viewed or modified based on the record's status. Status field permissions are present only within the Universal Tracking Application (UTA)/module.
Referencing Other Fields
Reference standard fields by name. Reference custom fields using cf_ followed by the field ID. The reference prefix depends on the context.
| Context | Reference Prefix |
|---|---|
| Level 1 | document.form1 |
| Level 2 and Level 3 | document.frmevent |
| Tab | document.frmedit |
For example, reference a standard field and a custom field at Level 1 as follows:
document.form1.startdate.value document.form1.cf_12345.value
Script Comment
SmartSimple automatically adds a comment at the start of any browser script when the script is added to the page. The comment states the browser script's custom field ID, which helps identify the field associated with each portion of script when viewing the page source. It displays as:
// Browser script cf_123456
Special - Button Custom Field
A Special - Button custom field adds a configurable button that opens a target page in the same window, a new tab, or a modal window when activated. Set permissions for the button on the Permissions & Availability tab.
| Setting | Description |
|---|---|
| Caption | An optional caption for the custom field. |
| URL | The target the button opens. Click the Lookup [binoculars] icon to search by Object Type and Action, or enter a relative path to another section of the system, such as the assignment grid. |
| Open in | Sets how the target displays when the button is activated. Modal Window opens an overlay above the current content to maintain context. New Tab opens the target in the Tab Bar at the bottom of the page. |
| Confirmation Message | A custom message shown to the user before the target opens. |
| Caption Location | Sets where the caption appears. No Caption aligns the button to the left of the record without a caption. |
| Button Label | The text that appears on the button. |
| Icon | An optional icon shown to the left of the button label text. |
| Icon Style | The style applied to the selected icon. |
| Tool Tip | Optional text that provides additional context for the button. |
| Instructions | Optional text that provides additional assistance or context for the button. |
Special - Web Page View Custom Field
A Special - Web Page View custom field creates a document-like view built from underlying entity data. It combines HTML with system variables and supports printing, exporting, saving, and converting to PDF.
HTML Template
The HTML template is the body of the document. It typically mixes HTML tags that control layout and formatting, static text that does not change, and variables that display live values when the document is generated. The HTML should conform to applicable accessibility requirements. Use the SmartFields Sample Template as a starter layout that renders fields in a review-friendly format and generally converts well to PDF.
General Options
A Special - Web Page View custom field offers the following general options.
| Option | Description |
|---|---|
| Open in Modal Window | Displays the document in a modal window. |
| Enable Printing | Adds a print button using the browser print function. For best results, export to PDF and print from the PDF. |
| Enable Editing | Allows temporary HTML edits that are not saved. |
| Enable Switching Language | Adds a language drop-down menu. Translated custom field values display when the language is switched. |
| Render As XML Document | Prepares the output as XML. |
| Default User ID as File Name | Names the stored file using the current user's ID when saving to file fields. If a file with that name already exists, it is replaced unless versioning is enabled on the target Multiple Files field. |
| Enable HCAI | Enables HCAI features, if available in the environment. |
| HCAI Automatically Redirect | Applies automatic HCAI redirect behavior, if configured. |
| Enable Field Selection for SmartFields | Allows a subset of fields to be selected for display. |
| Hide Instructions | Hides instruction text in exported PDFs. |
PDF Options
The following options control PDF generation for a Special - Web Page View custom field.
| Option | Description |
|---|---|
| Open Directly as PDF | Automatically generates a PDF without first showing the HTML preview. |
| Enable Online Signature | Enables online signature features on the document. |
| Enable Password Protection | Prompts for a password when saving or emailing a PDF. The password is required to open the PDF. |
| Enable Email as Attachment | Allows emailing the PDF as an attachment. |
| Enable Export | Adds an Export as DOCX button. Formatting may not be maintained. |
| Enable Save to Server | Saves the PDF into a Multiple Files field on the related entity. |
PDF Page Options
The following options control the layout of the generated PDF page.
| Option | Description |
|---|---|
| Fit to Page | Compresses content to fit onto one PDF page. |
| Landscape Mode | Outputs the PDF in landscape orientation. |
Paper Size
| Paper Size | Dimensions |
|---|---|
| Letter | 8.5 x 11 inches |
| Legal | 8 x 13 inches |
| Ledger | 11 x 17 inches |
| A4 | 297 x 210 mm |
Maximum Page Length
Defines the maximum number of pages allowed when saving the generated PDF into a Multiple Files field. This includes any pages appended using ssattach. If the PDF exceeds the limit, it is not stored.
HTML Options
A Special - Web Page View custom field offers the following options for HTML output.
| Option | Description |
|---|---|
| Enable Email as Attachment | Sends the document as the body of an email message. |
| Enable Save to Server | Saves the document as HTML into a Multiple Files field. |
| Enable Export | Exports a local HTML copy. |
Word Options
A Special - Web Page View custom field offers the following option for Word output.
| Option | Description |
|---|---|
| Enable Export | Exposes the Export as DOCX button. |
Value Storage
The following options control how a Special - Web Page View custom field links to file storage.
| Option | Description |
|---|---|
| Value Storage | Allows multiple custom fields to link to the same underlying file data. |
| Enforce Selection | Restricts file storage to the selected Multiple Files field only. |
Attaching PDFs with ssattach
ssattach appends one or more PDF documents, stored in a file field or Smart Folder, to the output. Attached PDFs do not appear in HTML preview mode; they appear only in PDF output, whether exported, saved, emailed, or produced by workflow as a PDF attachment.
<!--@ssattach(position;pdf file location)-->
The position is before or after. The pdf file location can be one of the following:
| Location Type | Syntax |
|---|---|
| Smart Folder | A path that begins with /files/ and omits the domain portion, for example /files/folder1/folder2/File_Name.pdf. |
| Single File Custom Field |
@CustomFieldName.value@. The .value extension is required. |
| Multiple Files Custom Field |
@CustomFieldName.files@. All PDF files stored in the field are attached. |
| Parent or Grandparent File Fields |
@parent.CustomFieldName.value@ or @parent.parent.CustomFieldName.files@. |
Conditional Display with SSLogic
Web Page View custom fields support a logic interpreter for conditional display and actions using sslogic. Content between the sslogic tag and the end tag displays when the condition is true.
<!--@sslogic(CONDITION)--> Content displayed when condition is true <!--@end-->
Images and Logos
A common pattern stores an image or logo in an Image type custom field and references it in the template using a variable, such as a branch or company logo field. When converting to PDF, image references often need to be relative paths rather than absolute URLs.
Layout, Printing, and PDF Output Tips
The following tips address common layout, printing, and PDF output issues in a Web Page View.
| Issue Area | Tip |
|---|---|
| Margins and Header or Footer | Control margins in both the HTML template and the browser print settings. If browser margins are not reduced, browser margins and document margins can combine and reduce the printed font size. |
| Default Font | If font and size are not set in the Web Page View, the display may be governed by browser settings. For consistent output, set font styles explicitly in the HTML. |
| Paragraph Spacing | Enter typically creates a new paragraph, which may add extra spacing due to margins. Shift plus Enter typically creates a line break, which avoids paragraph spacing. |
| Automatic PDF Conversion | To generate PDF output without clicking Export as PDF, place a pdfwrite script at the end of the source. |
Troubleshooting
| Issue | Resolution |
|---|---|
| Two variables run together because an ending or starting @ symbol is missing. | Place a non-breaking space between them, such as . |
| List syntax shows code instead of rendered values. | Insert a comment tag before the first cell tag. This is implementation specific. |