Changes

Jump to: navigation, search

Custom Field Type: Special - Advanced Data Table

51 bytes added, 20:01, 8 December 2016
no edit summary
* Cell is not empty
<pre>[this].length>0</pre>
Message: Please provide a value.
* Check the user selected something other than the default Combo Box value
<pre>[this]!="Default Combo Box Value"</pre>
 
Message: Please select a value.
Note, '''Default Combo Box Value''' should be substituted with the default value you have configured, e.g. '''--- Select One ---'''.
'''Default Combo Box Value''' should be substituted with the default value you have configured, e.g. '''--- Select One ---'''.
 * Integer greater than 0 (Allow only an integer or if your field on the XML is formatted to display/use a comma.)
<pre>parseInt([this])>0</pre>
Message: Please provide a numeric value greater than 0.
 
=== Validating values when saving record (SmartCheck, Submit Logic, Browser Script) ===
When creating validation for an XML custom field use the '''Appear Mandatory''' option. Appear mandatory does not enforce the validation but will make the field look mandatory (add the asterisk and color) just like the mandatory option. Once you have checked '''Appear Mandatory''', validate the XML worksheet using one of the following validation methods, when the record is saved.
 
==== SmartCheck Validation ====
 
Use SmartCheck for XML validation when possible. SmartCheck validation is a secure server side method. SmartCheck also displays all error messages in a context as well as in one central place.
{result.isPassed=false;
result.addMsg('xml_@fieldname.id@','YourAlertMessage'); }</pre>
 
==== Submit Logic Validation ====
Check an XML node in not blank when saving the XML worksheet.
<pre>"<ssEscape>@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@</ssEscape>"!=""</pre>
 
==== Special - Browser Script validation ====
You can enter JavaScript and jQuery into XML JavaScript Function input to create specific validations. Use the following syntax when referencing a value in your variables.
<pre>@xml.customfieldname.sectionnodename.rownodename.columnnodename@</pre>
== Displaying an XML ==
== Displaying XML Data==  === Displaying XML Data on a object ===
[[File:xml-readonly.png|The XML displayed in a read only|500px|border]]
# Navigate back to the XML custom field and click '''Save''' ('''Display Fields Refreshed Upon Edit''' will be updated with the custom field ID of the Read Only we just created. From now on when a user edits the XML the read only will be automatically updated. If you miss this step it will only refresh when the object is saved).
=== Access, Display and Format options for XML Data ===
<pre>@xml.fieldname.sectionnodename.rownodename[# ~currency_eur(columnodename.nodevalue,2)~ #]@</pre>Extract a numeric value and return in '''currency format with two decimal places''' for value pulled from a '''static''' XML section.<pre><!--@sscalculation(format("@xml.fieldname.sectionnodename.rownodename.columnodename.nodevalue@",2))--></pre>Extract date values and return with specific formatting using the following syntaxReturn the date in the user's date format.<pre>@xml.fieldname.sectionnodename.rownodename.formatdate(columnnodename.nodevalue)@</pre>Return the year.<pre>@xml.fieldname.sectionnodename.year(columnnodename.nodevalue)@</pre>Return the month.<pre>@xml.fieldname.sectionnodename.month(columnnodename.nodevalue)@</pre>Return the month name.<pre>@xml.fieldname.sectionnodename.monthname(columnnodename.nodevalue)@</pre>Return the day.<pre>@xml.fieldname.sectionnodename.day(columnnodename.nodevalue)@</pre>Return the day of the week.<pre>@xml.fieldname.sectionnodename.dayweek(columnnodename.nodevalue)@</pre>Count the number of rows the user created in a dynamic XML section.<pre>@xml.fieldname.sectionnodename.rownodename.nodecount@</pre>Return the XML feed (code) from the field.<pre>@fieldname.xmlvalue@</pre>Return multiple rows for XML with dynamic sections.<pre>@xml.fieldname.sectionnodename.rownodename[# ~columnnodename.nodevalue~ #]@</pre>Return Filtered row values for XML with dynamic sections.<pre>@xml.fieldname.sectionodename.rownodename[#(?criteria="~colunnnodename.nodevalue~" == "matching criteria")~columnnodename.nodevalue~ #]@</pre>
=== Styling an XML Data for web and print (PDF) ===
[[File:xml-readonly-styled.png|The XML styled at 700 pixels wide in a read only|500px|border]]
Administrators with CSS knowledge can modify the look and feel of their XMLs (e.g. make columns wider or thinner). To modify the look and feel of your XML, create an external CSS style sheet, upload the style sheet to a SmartFolder, add classes to the elements in your XML, and add a link to the style sheet in your '''Special - XML Data''' or '''Read Only - System Variable''' custom fields.
==== Styling XML Data for Print Printing ====
You can print your XML if you are displaying it in a '''Read Only - System Variable'''. Size your your XML to fit within 700 pixels wide (portrait) or 900 pixels wide (landscape) to avoid content cutting off, when a PDF is generated. If you have more than one section and more than a few columns, some of your content may cut off when printed if it is not sized. You will also notice columns between sections do not align. To fix this, we will use CSS in a SmartFolder and amend our '''Read Only - System Variable''', which is displaying the XML information.
Note: your cells must add up to 700 pixels if you are displaying your budget in a portrait PDF on letter size paper (8.5 x 11”).
==== Using different styles for Print and Web with XML Data ====
You can have one look for your XML when it is onscreen and another when it is in PDF format for printing. To do this, create two '''Read Only - System Variables''' custom fields, create two CSS style sheets in '''SmartFolders''' and reference the desired style sheet in the desired '''Read Only - System Variables'''. Then on the '''Read Only - System Variables''' for viewing on screen for '''SmartFields''' View choose '''Exclude'''. This custom field will no longer be included in PDFs generated using the SmartFields variable. For the other custom field you want to print, choose '''Only display for SmartFields View'''. Now one '''Read Only - System Variables''' will appear on screen and another when the PDF is created, and you can have a separate style sheet to control the look and feel of both.
<pre>ExtractValue([this], '/worksheet/sectionnodename/rownodename/columnnodename')</pre>
== XML Data - Appendix ==
=== Field options and settings ===
Smartstaff, administrator
4,478
edits

Navigation menu