Changes

Jump to: navigation, search

Advanced Custom Fields

116 bytes removed, 17:46, 10 September 2018
no edit summary
{{ Banner-UnderConstruction }}
==Overview==
In this article, you will add some additional [[Custom Fields|custom fields]] to the employee [[Role|role]]. The types of fields are widely used within [[SmartSimple]] and provide for versatile processing options.
In this article, you will add some additional [[Custom Fields|custom fields]] to the employee [[Role|role]]. The types of fields are widely used within [[SmartSimple]] and provide for versatile processing options.
* '''Calculated Field''' – Executes an expression to calculate a value and store the result in the field.
* '''Web Page Field''' – Creates a document based on values stored in the underlying [[Entity|entity]] or entities.
==Calculated Field==
You can use arithmetic, string, comparison operators and functions within the calculated [[Custom Field|custom field]].
You can use arithmetic, string, comparison operators and functions within the calculated [[Custom Field|custom field]].* References to other fields are always enclosed in square brackets: '''[variable1]'''. For example: '''[Salary]'''. * The calculations are performed when you click the '''Save''' button and save the page.
===Calculation Order on Page===
* Calculated field formulas are executed in the same order that the calculated fields are displayed on the page – left to right and top to bottom.
* You must not place fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.
* If the fields are ordered in this manner saving the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.
===Arithmetic Operators===
All values are treated as strings. For arithmetic operations, PARSEINT and PARSEFLOAT function are used to convert the string value to a numeric value.
All values are treated as strings. For arithmetic operations, PARSEINT and PARSEFLOAT function are used to convert the string value to a numeric value. example:
For example: * '''PARSEINT([Salary]) + PARSEINT([Bonus]) + PARSEINT([Car Allowance])''' - Add Salary to Bonus to Car Allowance and return an integer result.
* '''PARSEFLOAT([Salary]) / 26''' – Divides the Salary by 26 to show a bi-weekly amount.
===Adding a Calculated Field===
 
1. Add a [[Custom Field]] Type named '''Total Compensation''' to the '''Compensation''' tab.
[[Image:Advc4.png]]
4. Set the '''Number Format''' to '''Currency'''.
[[Image:Advc5.png]]
8. Edit an '''Employee''' record.
[[Image:Advc6.png]]
The calculated fields are blank as the record has not been saved with these fields.
[[Image:Advc7.png]]
==Web Page View Field==
 The [[Custom Field Type: Display Only – Web Page View|Web Page View]] field provides the ability to display a fully formatted document or web page. In constructing this type of field HTML is used in conjunction with the following variables.
In this example you will create a simple letter of offer displaying the employee’s name and address plus details of their compensation.
[[Image:Advc8.png]]
The HTML Template is used to store the body of the document and will be a mix of HTML code, static text and references to fields associated with the underlying [[Entity|entity]] – in this case the [[User|user]] [[Entity|entity]] and the employee [[Role|role]].
===Basic HTML Tags Required===
 
The following basic HTML tags should be added to the '''Web Page View'''.
[[Image:Advc9.png]]
The '''Web Page View''' is displayed.
[[Image:Advc10.png]]
* All variables have been added, except the salutation field that is not set in the underlying [[Entity|entity]].
* There are no options available for this document as you have yet to enable them.
===Suppressing Missing Fields===
 A special tag is used to suppress any fields that are missing from the underlying [[Entity|entity]] - [[Image:Advc2.png]]. Placing this tag in front of any field that may not be present will suppress the display of the variable name.
1. Display the '''Web Page View''' [[Custom Fields|custom field]].
[[Image:Advc11.png]]
6. '''Close''' the Window.
===Document Options===
You control which options are available to the [[User|user]] of each [[Custom Field Type: Display Only – Web Page View|Web Page View]] field. Each of the selected options will add a button to the top of the [[Custom Field Type: Display Only – Web Page View|Web Page View]] field. The following example shows how the field will look with all options enabled:
You control which options are available to the [[User|user]] of each [[Custom Field TypeImage: Display Only – Web Page View|Web Page View]] fieldAdvc12. Each of the selected options will add a button to the top of the [[Custom Field Type: Display Only – Web Page View|Web Page Viewpng]] field. The following example shows how the field will look with all options enabled:
[[Image:Advc12.png]]
* '''Show Menu''' – check box that defines if a [[Menu|menu]] should be shown in the document window.
===General Options===
 
* '''Allow Printing''' – enables the [[User|user]] to print the resultant document.
* '''Allow Editing''' – enables the [[User|user]] to edit the document with the HTML Editor
===PDF Options===
 
* '''Enable Password Protection''' – enables the [[User|user]] to [[Password|password]] protect the document (generally used when the document is going to be emailed).
* '''Send as Email''' – enables the [[User|user]] to send the PDF as an attachment to an email message.
===HTML Options===
 
* '''Send as Email''' – enables the [[User|user]] to send the document as the body of an email message.
* '''Save to Multiple File Field''' – enables the [[User|user]] to save the document as an HTML document into any multiple file type fields in the related [[Entity|entity]].
==Using the Link – Multiple Files Field==
The final [[Custom Fields|custom field]] type will be the '''Multiple Files Field'''. This field stores multiple files into a single field and is used to store:
The final [[Custom Fields|custom field]] type will be the '''Multiple Files Field'''. This field stores multiple files into a single field and is used to store:
* Uploaded documents.
* Documents that are created using the [[Custom Field Type: Display Only – Web Page View|Web Page View]] type field using the '''Store to Server''' option.
[[Image:Advs13.png]]
===Multiple Files Field Options===
The following options are available for this field type:
The following options are available for this field type:* '''Keep Version''' – provides for version control over documents added. When a second document with the same name is added, the name will be appended with V_# (where # is the version number starting at 1).
* '''No Deletion''' – suppress the [[User|user’s]] ability to delete any files stored in the field and '''Manager Permission''' is required by the [[User|user]] to delete a – '''Allow Delete Multiple Files Fields'''.
* '''Sort Order''' – files stored in the field can be ordered by '''File Name''', '''File Size''' or '''Update Date''' (descending).
[[Image:Advc14.png]]
6. Select the Folder Name '''Employee Related Documents'''.
[[Image:Advc15.png]]
8. Click the '''OK''' button.
[[Image:Advc16.png]]
9. Enter a [[Password|password]].
[[Image:Advc17.png]]
11. Close the '''Window'''.
[[Image:Advc18.png]]
The document is saved into the '''Employee Related Documents''' field.
Smartstaff, administrator
421
edits

Navigation menu