Special - Button, Special - Browser Script, and Special - Web Page View custom fields support advanced configuration beyond their basic settings in SmartSimple. A Special - Button custom field opens a target page in a modal window, a new tab, or the same window. A Special - Browser Script custom field totals the values of a dynamic custom field. A Special - Web Page View custom field can append stored PDF documents to its output, generate a PDF automatically, or enable editing for minor formatting corrections before the document is generated. For more information, see Custom Fields: Special Control Types Settings Reference.
Who: Global administrators
When to Use Custom Fields: Special Control Types
Use Special Control Types when:
- A special control field needs behavior beyond its basic settings.
- A Special - Button fits a record that needs a button to open a profile, a grid, or a new record.
- A Special - Browser Script fits a form that must total repeated values.
- PDF attachment, automatic PDF generation, and one-time formatting edits fit a Special - Web Page View custom field used to produce documents.
Create a Special - Button Custom Field
A Special - Button custom field opens a target page in the same window, a new tab, or a modal window when it is activated.
To create a Special - Button custom field:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the New Field [+] button.
- Click the Field Type field and select Special - Button from the drop-down menu.
- Click the Caption field and enter the applicable information.
- Locate the URL field and click the URL Lookup [binoculars] icon.
- A URL Lookup modal will open.
- Enter the relevant information in the URL Lookup modal, and click Apply.
- Locate the Open in field and click the applicable option.
- Click Main Window to open the object and replace the current content.
- Click Modal Window to open the object in an overlay above the current content.
- Click New Tab to open the object in the Tab Bar at the bottom of the page.
- Click the Confirmation Message field and add text to present a custom message before the target opens.
- For example, a message is appropriate when the button redirects the user away from a page that may have unsaved changes.
- This field is optional.
- Locate the Display Section and the Caption Location field and click the applicable option.
- Click No Caption to align the button to the left of the record without a caption.
- Click the Button Label field and add the text to appear on the button.
- Click the Icon Style field and select a style from the drop-down menu.
- This field is optional.
- Click the Icon field and select the applicable icon.
- Icons are positioned to the left of the button label text.
- This field is optional.
- Click the Tool Tip or Instructions field and enter the applicable information to provide additional context.
- These fields are optional.
- These fields are optional.
- Click the Permissions & Availability tab and set the applicable permissions, and then click Save.
Sum a Dynamic Custom Field with a Special - Browser Script
Summing a dynamic custom field requires three custom fields: a Text Box - Text Single Line custom field to store the total, a Special - Browser Script custom field to run the calculation, and the Dynamic Data - Dynamic Control Field being totaled. Place two of the fields before the dynamic custom field, using a smaller display order, and place the third field within the dynamic custom field. For example, if the dynamic custom field has a display order of 2050, the two preceding fields must use a smaller display order, such as 2045 and 2047.
Create a Text Box Field
To create a Text Box - Text Single Line custom field:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the New Field [+] button.
- Click the Field Type field and select Text Box - Text Single Line from the drop-down menu.
- This field stores the total. Note its Field ID, which appears in the List View on the Custom Fields page.
- This field stores the total. Note its Field ID, which appears in the List View on the Custom Fields page.
- Complete the applicable fields, and then click Save. See the Special - Browser Script section in Custom Fields: Special Control Types Settings Reference.
Create a Special - Browser Script Field
To create a Special - Browser Script custom field:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the New Field [+] button.
- Click the Field Type field and select Special - Browser Script from the drop-down menu.
- Click the Custom Script field and add the following script.
- Replace xxxxxx with the Field ID of the Text Box - Text Single Line custom field.
//Set the field that stores the total to read only
document.frmevent.cf_xxxxxx.readOnly=true;
//Take the value of the passed in field and add it to the total sum.
function addTotal(valuetxt,index)
{
// if the index is equal to 1 then reset the sum value to zero
if (index == 1 )
document.frmevent.cf_xxxxxx.value=0;
//update the value
document.frmevent.cf_xxxxxx.value = parseFloat(document.frmevent.cf_xxxxxx.value) + parseFloat(valuetxt);
}- Complete the applicable fields, and then click Save. See the Special - Browser Script section in Custom Fields: Special Control Types Settings Reference.
Edit the Dynamic Data - Dynamic Control Field
To edit the Dynamic Data - Dynamic Control Field:
- Click the edit [pencil] icon next to the Dynamic Data - Dynamic Control Field.
- Create a new sub field, click the Field Type field, and then select Special - Browser Script.
- Click the Custom Script field and add the following script.
- Replace xxxxx1 with the Field ID of the dynamic custom field, and replace xxxxx2 and xxxxx3 with the Field IDs of the fields to total.
var expenseCF = new Array('cf_xxxxx1', 'cf_xxxxx2', 'cf_xxxxx3');
var i = 0;
var number = eval("document.frmevent."+ expenseCF[0] + ".value;");
number = parseInt(number);
for (i = 1; i <= number; i++)
{
var valuetxt = eval("document.frmevent."+ expenseCF[i] + ".value;");
if (valuetxt != undefined)
{ //Call the function addTotal so that it adds the sum together
addTotal(valuetxt,i);
}
}Attach PDFs to a Web Page View Custom Field Output
A Special - Web Page View custom field can append one or more PDF documents, stored in a file field or SmartFolder, to its output using ssattach. Attached PDFs appear only when the output is generated as a PDF, and they do not appear in HTML preview mode.
To attach a PDF to the output:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the New Field [+] button.
- Click the Field Type field and select Special - Web Page View from the drop-down menu.
- Locate the HTML Template field and click SmartFields Sample Template.
- Add an ssattach tag where the PDF should appear, setting the position to before or after and the location to a Smart Folder path, a single file custom field, a multiple files custom field, or a parent field reference.
- Complete the remaining applicable fields, and then click Save. See the Special - Web Page View section in Custom Fields: Special Control Types Settings Reference.
Example
The following tag appends a Smart Folder PDF before the Web Page View custom field content:
<!--@ssattach(before;/files/1234/123/myfile.pdf)-->
Example
The following tag appends a PDF from a single file custom field named AttachPDFFile:
<!--@ssattach(before;@AttachPDFFile.value@)-->
Generate PDF Output Automatically from a Web Page View Custom Field
A Special - Web Page View custom field can generate PDF output without the user clicking Export as PDF.
To generate PDF output automatically:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the New Field [+] button.
- Click the Field Type field and select Special - Web Page View from the drop-down menu.
- Locate the HTML Template field and click SmartFields Sample Template.
- Add the following script at the end of the source.
<script language="javascript"> parent.pdfwrite(); </script>
- Complete the remaining applicable fields, and then click Save. See the Special - Web Page View section in Custom Fields: Special Control Types Settings Reference.
Edit a Web Page View Custom Field Output
A Special - Web Page View custom field can include an editing option that provides an editable, simplified version of the output for one-time formatting or text corrections before the document is generated.
Enable Edits on a Web Page View Custom Field from a UTA/Module
To enable editing on a Special - Web Page View custom field for a UTA/module:
- Click the Menu icon in the upper navigation bar, and then select the relevant UTA/module from the Applications drop-down menu.
- Click the Configuration Settings gear.
- Click the relevant Level 1, Level 2, or Level 3 tab.
- Locate the General Settings section and click Custom Fields.
- Click the edit [pencil] icon next to the applicable Special - Web Page View custom field.
- Locate the Document section, toggle Enable Editing on, toggle Open Directly as PDF off, and click Save.
Enable Edits on a Web Page View Custom Field from Global Settings
To enable editing on a Special - Web Page View custom field from Global Settings:
- Click the System Administration gear in the upper navigation bar, and then select Global Settings.
- Click the relevant tab.
- Custom fields are located on the Organizations, User, Associations, and Transactions tabs.
- Locate the General Settings section and click Custom Fields.
- Click the edit [pencil] icon next to the applicable Special - Web Page View custom field.
- Locate the Document section, toggle Enable Editing on, toggle Open Directly as PDF off, and click Save.
Make Edits on a Web Page View Custom Field Output
Editing must be enabled for a Special - Web Page View custom field before its output can be edited directly from the record, prior to generating the document.
To edit a Special - Web Page View custom field output:
- On the record, click the relevant button for the Special - Web Page View custom field.
- Special Web Page View custom fields typically appear as buttons. Thee caption entered in the field settings becomes the button name.
- A new window opens.
- Click the Edit button in the top-left corner.
- A rich text editor opens.
- Modify font styles, text size, spacing, and other formatting options as needed.
- Click Preview to review the changes before generating the document.
- Click the relevant button to save the edited Web Page View custom field as a PDF or DOCX.
- The generated PDF or DOCX can be exported.
- The generated PDF or DOCX can be exported.