Changes

Jump to: navigation, search

Custom Field Type: Special - Advanced Data Table

6,073 bytes added, 19:12, 10 September 2020
Access, Display and Format options for Data
==Overview=General Description=XML (Extensible Markup Language) is a type of custom field used to create budgets and lists of information[[File:xmlSample. This advanced custom png|thumb|none|500px|Example field opens in configured as a modal window, it can have multiple sections, and it is robustly configurable (formulas, validation, reporting)budget sheet. ]]
If you are looking This field type can be used to create a basic lists worksheets or tables such as budgetsheets, and lists of information. A wide range of complexity is supported from very simple tables to multi-section, multi-year budgets. This is accomplished through the ability to configure sub-sections within the same worksheet, you can and also use the define automatic cell calculations. This all adds up to a very robust, and flexible field called '''Special - In-Line Data Grid.'''
[[File:xmlSampleBy default, the data for this field is stored in the structured XML (Extensible Markup Language) format.png|The look However, you also have the option to instead use this field as a presentation layer for lists of an XML|500px|border]]sub-activity records. For example, you may use this field on a UTA Level 1 record to display any associated UTA Level 2 records for a user to easily update the activities or create new activities.
Creating If you are looking to create a XML is a multi step process. For convenience we have grouped how basic list or budget, you do specific tasks under several groupingscan also use the field called '''[[Custom Field Type: Special - In-Line Data Grid|Special - In-Line Data Grid]].'''
'''Configuring the XML {| class="wikitable"|-||Summary|||-||Commonly Used in Markets (Philanthropy, Research, Insurance)||All|-||Used By (User Type)||All|-||Requires Administrator Setup||Yes|-||Configuration Complexity (Low, Medium, High)||High|-||Time to Configure (Minutes, Hours, Days)||Hours|}==Field Options==All common options:<br />[[Custom Fields - General Information #General_Settings|General Settings]]<br />[[Custom Fields - Essentials'''General Information #Role Field Permissions and Status Field Permissions|Permissions & Availability]]<br />*Creating a Special [[Custom Fields - XML custom fieldGeneral Information #Classic Options|Classic Options]]<br />*Using XMLs Section Builder For further information, please refer to create static XML[[Custom Fields – General Information]].<br /><br />*Using XMLs Section Builder Options listed below are specific to create dynamic XMLsthis particular field type.<br />*Creating a {{XSL template for Template}} {{XML Tag Mapping}} {{XML Javascript Function}} {{Show View XMLButton}}
'''Configuring the XML - Advanced'''*Creating formulas (calculations) in XML*Adding a formula to a XML cell (working with data in the same section)*Adding a formula to a XML cell (working with data in the different sections)*Validate XML values when saving the worksheet*Validating values when saving record (SmartCheck, Submit Logic, Browser Script)'''Displaying the XML'''*Displaying an XML on a object*Access, Display and Format options for XML*Styling an XML for web and print (PDF)*Reporting on a XML'''XML - Appendix'''*Field options and settings*Example of an XML{{Show Upload Button}}
== Configuring - Essentials ===== Creating a Special - XML Data custom field ==={{Show Up/Down Button}}
{{Show Clear Button}}
{{Custom Field Ids}} =Configuration - Essentials===Creating the field==Typically XML Advanced Data table custom fields are created for UTA level 1, 2 or 3, (example: e.g. a grant application) or they are created for organizations. To create a XML custom the field: #Navigate to the desired place, settings area where you want to create the XML custom field a worksheet (example e.g. the UTA level 1).
# Click the '''New Field''' (+) button.
# For Field Type select '''Special - XML Advanced DataTable'''.# Enter a '''Field Name''' , '''Caption''' then '''Save'''.# Use the '''Section Builder''' button to begin process of creating the XML tables.# Use the '''Custom Field''' button to navigate back from the Section Builder to the Field settings to configure the display of tables. ==Create a Simple Table==Using the '''Section Builder''' you can create sections and define the attributes of each section and the cells within them. You can define the number of rows and columns, the display format, calculation formulas, and modify other parameters. [[File:xml-sectionbuilder1.png|thumb|none|500px|The section builder.]] # While editing the custom field click on the '''CaptionSection Builder''' button (the four square icon) in the action bar.# Create a '''New''' section and enter a '''Section Name''' (e.g. Expenses).# Enter '''Number of Rows''' and '''Number of Columns'''desired.# Click Once you '''Save'''you will be brought to the '''Cell Details''' tab.# Define a '''Display Name''' for the column headers (e.g. Item, Amount, Date).# Define a '''Display Name''' for the first column of each row (e.g. Salaries, Equipment, Other).# Within each of the column headers you can define a '''Format''' for the column (e.g. Text, Currency, Date). For the Number format option you may also specify a precision.# When you are done click the '''Build button'''. Note:
=== Create XML with pre-defined number # When you choose the format '''Currency''' in a column header, make sure you specify the column alignment as '''Right Align'''. This way it will be easy for the user to compare the values. This step is also required if you plan to export this data to PDF for printing.# You must use unique node names of sections, rows ===[[File:xml-sectionbuilder, and columns within this field.png|The section builder|500px]]
Use the XML '''Section Builder''' to create sections, define your rows, columns, formulas, and style your XML. Note you must manually enable the '''Section Builder''' before you can use it.# Scroll down to the '''Options''' section and check '''Enable Builder'''.# Click '''Save'''.# In the action bar click on the '''Section Builder''' button (it has four squares on it).# Enter ==Create a Table with a '''Section Name''' (example: '''expense''').# Click into the '''Section Node Name''' (the name auto populates. Note: '''Section Node Names''' are case sensitive).# Enter '''Dynamic Number of Rows''' desired.==# Enter '''Number of Columns''' desired.# Check '''Apply Default Styles'''[[File:xmlDynamic.# Navigate to the '''Cell Grid''' in the lower png|thumb|none|500px|Example section of the page.# Click into the first cell of the '''Cell Grid''' at the top left.# Enter a '''Display Name'''.# Click into the top row of the column labeled '''1'''.# Enter a '''Display Name''' and a '''Node Name'''.# If desired choose the '''Format''' (example: number, comma, date, currency, percent) and other settings for this column.# Repeat for the remaining column headers.# Click into the first cell in the row labeled '''1'''.# Enter a '''Display Name''' and '''Node Name'''.# Repeat for the remaining row labels.# Click the '''Build''' button.# When you are done, navigate from the builder back set to the field by clicking the '''Field''' button.Note: Do not use the same node names across different sections, dynamic rows or columns in the xml.]]
=== Create XML with In addition to defining a set number of columns and rows, you can also configure a section to handle a dynamic number of rows ===[[File:xml-dynamic.png|The dynamic XML|500px]]user entering the data can add rows as necessary at time of entry. This is done by entering '''0''' for the '''Number of Rows''', which in turn exposes the following configuration options:
* '''Maximum Number of Rows''': Set a maximum limit to the number of rows that can be entered, or leave as 0 for no limit.
* '''Maximum Message''': The message to be displayed when the maximum limit is set and reached by a user. A default message is displayed if this input is empty.
In '''Using XMLs Section Builder''' above, we saw how you create a static XML (A XML with a defined number Setting the Number of rows). You can choose Rows to let the user define the number of rows they will get. You do this by entering '''0''' for also exposes the number of rows. When you enter '''0''' following configuration options for number of rows the user will get a plus button where they can choose to add as many rows as they need. When creating a dynamic XML if you click into any each column header, you will notice a property called '''Has Total'''. Check '''Has Total''' if you want to automatically sum and display all the items in that column. Note even though you set the number of rows to '''0''' you still need to configure one row of data which will be used to format within the dynamically created rows. You may also set a maximum number of rows for a dynamic XML section.Cell Details tab:
=== Creating * '''Has Total''': Display the total sum of the column.* '''Total Row Label''': For columns without a XSL template total display this option allows you to enter a label for XML ===[[File:xml-xslthe total sum of another column. For example, if column 3 was displaying a total, then you could configure the '''Total Row Label''' of column 2 to display 'Total'.png|The XSL template|500px]]
==Configure the Display of Tables==
The presentation of the XML Data custom field is configured in the '''General Settings''' tab of the field. This is defined in the XSL Template (Extensible Style Sheet Language) inputn. The XSL Template includes a sample template link. Once you have inserted sample template you will need to specify which sections should appear and where they should appear.
[[File:xml-xsl.png|thumb|none|500px|The XSL stands for Extensible Style Sheet Language; the XSL template defines how the XML will look. To make this easy we have included a sample template. All you have to do is add the template and specify where you want each section to appear. This is done on the field and not in the section builderconfiguration.]]
# While editing the custom field locate the '''XSL Template''' link and insert the '''Sample Template'''.
# Locate the marker below.
# In the Section builder click the field button.# In the '''XSL Template''' click the '''Sample Template''' link.# Replace <pre><!---- Insert section variable here ----></pre> # Below this marker, insert variable references to the each section with '''the following syntax (e.g. @section.''SectionNodeName''Expenses@'''.# Click '''Save''') in the order in which you wish the sections to appear.
Note:
The syntax # Make sure you are using the '''Section Node Name''' and not the '''Section Name'''# '''Section Node Name''' is case sensitive Example if your '''Section Node Name''' is '''Expenses''' than @section.Expenses@ will work but @section.expenses@ will not because it has a lower case ''SectionNodeName''@e''' will display the section we created using the section builder.
@section.''SectionNodeName''@
Note: you must replace '''SectionNodeName''' with the name you gave your section =Configuration - Advanced===Creating formulas (examplecalculations) in cells==[[File: '''@section.''expense''@'''), the section node name is case sensitive, and you must remove the html commentsxml-formula.png|500px|border|Adding a formula]]
== Configuring In the section builder you declare the formatting such as currency or numeric for specific columns as well as choose the XML - Advanced ==precision.=== Creating formulas You can also do calculations on numeric and currency data (calculations) in XML ==e.g. to sum the contents of column one, over two rows, enter '''=[1,1]+[File:xml-formula2,1]''').png|Adding a formula|500px]]
In the section builder you declare the formatting such as currency or numeric for specific columns as well as settings like precision. If you are collecting numeric or currency data you will likely want to do calculations on this information found within your XML (example: to sum the contents of column one, over two rows, enter '''=[1,1]+[2,1]''').
=== Adding a formula to a XML cell (working with data in the same section) ===# Navigate to your XML custom field.# Click the '''Section Builder''' button in the action bar (section builder must be enabled).# Click the desired '''Section'''to edit it.
# Click the desired '''Cell'''.
# In Enter the '''Cell Properties''' enter your desired formula into the '''Content''' input.
# Click '''Build'''.
The Syntax for basic calculations within a section:
 {| borderclass="1wikitable"|-||'''Operation'''||'''Symbol'''||'''Example'''
|-
|| Add|| +|| =[row#,column#]+[row#,column#]
|-
|| Subtract|| -|| =[row#,column#]-[row#,column#]
|-
|| Divide|| /|| =[row#,column#]/[row#,column#]
|-
|| Multiply|| *|| =[row#,column#]*[row#,column#]
|}
So if you wanted to add the values of row 1 and 2 together in column 1 you would enter '''=[1,1]+[2,1]'''.
=== Adding a formula to a XML cell (working with data in the different sections) ===  
Refer to cells in different sections using this syntax
'''[@section.''sectionnodenamesectionname''.id@_''rownodename''_''columnnodename'']'''
Example e.g. '''=[@section.''expense''.id@_''Total_Amount'']-[@section.''income''.id@_''Existing-funds''_''Amount'']'''
=== Validate XML values when saving If you need want to display data in the worksheet ===head of a section (row 0) from another section you can use the following:
'''@xml.customfieldname.sectionnodename.rownodename.columnnodename@'''
==Validate values when saving the worksheet==
Clicking on a cell inside the section builder will present you with the cell properties. There are two cell properties used for the validation of cells when the xml worksheet is saved.
* '''Validation Script''': Validates the input field.
* '''Validation Message''': Content that is displayed, when the validation script is not true (e.g. Value must be greater than 100).
'''Validation Script''': Validates the input field.
Examples
'''Validation Message''': Content that is displayed, when the validation script is not true (Example: Value must be * Total Amount greater than 100).0, for currency formatted column totals
<pre>ssParseNum([this])>0</pre>
Message: Total must be greater than $0.00
Examples:
Total Amount greater than 0, for currency formatted column totals<pre>ssParseNum([this])>0</pre>Message: Total must be greater than $0.00* Date is at least 30 days in the future
 
Date is at least 30 days in the future
<pre>datediff(ConvertDateStr([this],'@dateformat@'),'@date(currentdate)@','d') > 30</pre>
Message: Please select a date that is at least thirty 30 days from today.
 * 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 ---'''.
Message: Please select a value.
'''Default Combo Box Value''' should be substituted with the default value you have configured, example '''--- Select One ---'''.
* Integer greater than 0 (Allow only an integer or if your field on the XML is formatted to display/use a comma.)
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) ===
In addition to validating values when you save * Value entered in one cell cannot be more than 20% above or below the XML worksheet you can also validate the XML worksheet when you save the record value in another cell <pre>(ssParseNum([this])>=(ssParseNum([1,4])*(0.80)) && ssParseNum([this])<=(ssParseNum(example save a level [1 grant application,4])*1.20))</pre>Message: Value entered in one cell cannot be more than 20% above or below the value in another cell  
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 ==Validating values when saving record (add the asterisk and colorSmartCheck, Submit Logic, Browser Script) just like ==In addition to validating values when you save the mandatory option. Once worksheet you have checked '''Appear Mandatory''', can also validate the XML worksheet using one of the following validation methods, when you save the record is saved(e.g. save a level 1 grant application).
==== SmartCheck Validation ====When creating validation for an this custom field use the '''Appear Mandatory''' option. Appear mandatory does not enforce the validation but will make the field look mandatory (it adds the asterisk and or color) just like the mandatory option. Once you have checked '''Appear Mandatory''', validate this field using one of the following validation methods, when the record is saved.
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.
Validate an XML table node is not empty and display a message.
===SmartCheck Validation===Use SmartCheck for 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. Validate a table node is not empty and display a message. <pre>if("<ssEscape>@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@</ssEscape>"=="")
{result.isPassed=false;
result.addMsg('xml_@fieldname.id@','YourAlertMessage'); }</pre>
==== Submit Logic Validation ====
===Submit Logic Validation===Use Submit Logic in conjunction with Submit Buttons to Validate a XML worksheet.
Check an XML a node in not blank when saving the XML worksheet.<pre>"<ssEscape>@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@</ssEscape>"!=""</pre>
<pre>"@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@"!==== Special - Browser Script validation ====""</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>
 The following function allows you to check for an already selected value from an existing row when using dynamic rows: <pre>// REPLACE '7172_dsItem_Population' AND '7172_dsItem_Population_' WITH SPECIFIC XML FIELD ID var saveFunc=saveXML;saveXML=function() { checkdupeval(); }function checkdupeval() {var result = 0;var numOfRows = document.getElementsByName('7172_dsItem_Population'); //section nodevar ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='7172_dsItem_Population_'+ctr;var lastfield='7172_dsItem_Population_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each population no more than once."); result = 1;}}if(result== Displaying 0) saveFunc(); }</pre> The following function allows you to check for an already selected value from an existing row when using dynamic rows on multiple sections: <pre>var saveFunc=saveXML;saveXML=function() {if (checkdupeval_Section1() == 0 && checkdupeval_Section2() == 0 && checkdupeval_Section3() == 0) { saveFunc(); }  }function checkdupeval_Section1() {var result = 0;var numOfRows = document.getElementsByName('16580_row_COUNTY'); // REPLACE '16580_row_COUNTY' AND '16580_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 1var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16580_row_COUNTY_'+ctr;var lastfield='16580_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 1."); result = 1;}} return result; } function checkdupeval_Section2() {var result = 0;var numOfRows = document.getElementsByName('16581_row_COUNTY'); // REPLACE '16581_row_COUNTY' AND '16581_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 2var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16581_row_COUNTY_'+ctr;var lastfield='16581_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 2."); result = 1;}} return result;} function checkdupeval_Section3() {var result = 0;var numOfRows = document.getElementsByName('16582_row_COUNTY'); // REPLACE '16582_row_COUNTY' AND '16582_row_COUNTY_' WITH SPECIFIC XML sectionid_rownodename_columnnodename for Section 3var ctr=1;for (ctr=1;ctr<numOfRows.length;ctr++){var field1='16582_row_COUNTY_'+ctr;var lastfield='16582_row_COUNTY_'+numOfRows.length;var a = document.getElementById(field1).value;var b = document.getElementById(lastfield).value;if( a == b){ alert ("Please list each option no more than once for Section 3."); result = 1;}} return result; }</pre> ==Managing Level 2 / 3 Activities with a Section==System administrators can configure this field to add, modify or delete {{l2}} records on a {{l1}} entity or {{l3}} records on a {{l2}} entity. In the '''Section Builder''', when the ''Number of Rows'' for a Section is set to '0', the ''Enable Mapping'' option will be shown. [[Image:XMLEnableMapping2017.png|link=|800px|border]]
=== Displaying an XML on a object ===[[File:xml-readonlyWhen '''Enable Mapping''' is selected, you can choose one type of activities to be referenced by this field.png|The XML displayed in a read only|500px]]
The '''Activity Status Filter''' setting allows you to filter the activities to be referenced by status.
 
The '''Additional Filter''' setting allows you to select custom fields and associated values. These are used to filter the existing activities that will be listed within this field. The custom fields used have to be fields with pre-defined options (e.g. [[Custom_Field_Type:_Select_One_-_Dropdown_List|Select One - Dropdown List]], and [[Custom_Field_Type:_Select_Many_–_Check_Boxes|Select Many – Check Boxes]]).
 
[[Image:XMLEnableMappingFilter2017.png|link=|650px|border]]
 
 
When building your section, you will need to map the fields on the {{l2}}s that will be referenced by the section.
 
For each Section column, enter the field name from the Level 2 type that you have selected from the '''Activity Type''' dropdown in the '''Map Field''' section:
 
[[Image:MappingL2Fields2017.png|link=|800px|border]]
 
 
The syntax for the '''Map Field''' section is:
 
* for [[custom fields]], the field name (i.e., '''Fund Name''');
* for [[Standard_Field|Standard Field]]s, use the prefix '''sf_''' and then the system name for the standard field (i.e., '''sf_status''').
 
see [[Standard Level 2 Field List]] article for a list of system names for {{l2}} standard fields.
If the Standard or Custom field has a limited number of pre-defined options then these need to be defined in the Content section of the cell properties.
 
You may need to reference some standard field options using both the displayed name and stored ID values.
 
[[Image:MappingL2Fields2018.png|link=|650px|border]]
 
 
 
When this section is added to the Template of your field, the list of {{l2}} activities will be displayed when the worksheet is opened. Level 2s can be added, deleted and modified directly from the {{l1}} Advanced Data Table field.
 
=Displaying XML Data=
==Displaying Advanced Data Table data on an object==
[[File:xml-readonly.png|500px|border|The XML displayed in a read only]]
 
 
The Advanced Data Table custom field can open in a new or modal window. The '''Open in Modal Window''' option is recommended. You can toggle this on under '''Document Options'''.
 
By default the information entered into this field type is hidden until the user clicks a button. But there is a way to display the information entered into this field on your object, such as a grant application, without requiring the user to click a button and launch the modal window.
 
Use the '''Display - Text and Variables''' custom field to display the content of the Advanced Data Table on the object. The same syntax can be used elsewhere in the system when referencing this field's values.
The XML custom field opens in a modal window and the user must click a button to launch the modal window and see the information entered. You can however, display the information entered into a '''Special - XML''' custom field on your object, such as a grant application, without requiring the user to click a button and launch the modal window. To do this we use the '''Read Only – System Variables''' custom field. The same syntax can be used elsewhere in the system (examples: include Display Only - Web Page View, Special MS Word Merge, visibility conditions, etc.) when referencing the xml values.
# Go to the desired location where you want to create the custom field.
# Click the '''New Field''' (+) button in the action bar.
# For '''Field Type''' select '''Read Only – System Display - Text and Variables'''.
# Enter a '''Field Name'''.
# For '''Variables''' enter '''@xml.''CustomFieldName''.''SectionNodeName''.html@''' (replace the '''CustomFieldName ''' and '''SectionNodeName ''' with the actual names from your XMLexample '''@xml.Budget.Expenses.html@''').
# Scroll Down to the '''Display''' section.
# For '''Caption''' select '''Hide Caption''' (we recommended that you hide the caption for the display so that you can utilize the full screen width).
# Click '''Save'''.
# Navigate back to the XML custom Advanced Data Table field and click '''Save''' ('''Display Fields Refreshed Upon Edit''' will be updated with this updates the linkage and ensures when data is entered into the custom field ID of worksheet the Read Only we just created. From now data displayed on when a user edits the XML the read only object will be also get automatically updated. If you miss this step it , information entered into the Advanced Data Table will only refresh in the Display - Text and Variables field when the object is saved).
=== Access, Note: you may want to create two '''Display - Text and Format options Variables''' custom fields for XML ===each '''Advanced Data Table''' custom field. One that you will use for printing and one for displaying on the object.
==Access, Display and Format options for Data==
The syntax options for accessing, displaying and formatting the data from the Advanced Data Table field is detailed below.
Access data from within the XML field.
* Extract the value from a specific individual cell using the '''field name'''. 
<pre>@xml.fieldname.sectionnodename.rownodename.columnnodename@</pre>
* Extract the value from a specific individual cell using the '''field id'''.
Extract the value from a specific individual cell using the '''field id'''.
<pre>@xml.#fieldid#.sectionnodename.rownodename.columnnodename@</pre>
* Extract numeric value and return in '''comma format''' (i.e. 1000 will display as 1,000).
Extract numeric value and return in '''comma format''' (i.e. 1000 will display as 1,000).
<pre>@xml.fieldname.sectionnodename.rownodename[# ~comma(columnnodename.nodevalue)~ #]@</pre>
* Extract a numeric value and return in '''currency format'''.
Extract a numeric value and return in '''currency format'''.
<pre>@xml.fieldname.sectionnodename.rownodename[# ~currency(columnodename.nodevalue)~ #]@</pre>
Extract a numeric value and return in a '''specific currency format'''.
* Extract a numeric value and return in a '''specific currency format'''.
<pre>@xml.fieldname.sectionnodename.rownodename[# ~currency_eur(columnodename.nodevalue)~ #]@</pre>
Further currency formatting options below
 
Specific currency formatting examples:
{| border="1"
|-
|| usd|| $300.00
|-
|| eur|| €300.00
|-
|| jpy|| ¥ 300
|-
|| zar|| R 300.00
|-
|| inr|| ₹300.00
|-
|| frca|| 300,00 $
|}
* Extract a numeric value and return in '''currency format with two decimal places'''. If pulled from a '''dynamic''' XML section then you will see multiple values.<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 for web and print <pre>@xml.fieldname.sectionnodename.rownodename[# ~currency_eur(PDFcolumnodename.nodevalue,2) ===[[File:xml-readonly-styled.png|The XML styled at 700 pixels wide in a read only|500px]~ #]@</pre>
If you enable * Extract a value and return the '''Section Builder''' and check '''Apply Default Styles''' number of characters in each section of your XML custom field, the field will be automatically styled. If you have manually added CSS classes to your cells, you will need to remove those classes and check '''Apply Default Styles''' again and then click '''Build''' on your XML in section builder.
Administrators with CSS knowledge can modify the look and feel of their XMLs (Example: make columns wider or thinner)<pre>@xml. 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''' or '''Read Only - System Variable''' custom fieldsfieldname.sectionnodename.rownodename.columnodename.nodevaluelength@</pre>
==== Styling * Extract a numeric value and return in '''currency format with two decimal places''' for value pulled from a '''static''' XML for Print ====section.
You can print your XML if you are displaying it in a '''Read Only <pre><!- System Variable'''. Size your your XML to fit within 700 pixels wide -@sscalculation(portrait) or 900 pixels wide format(landscape) to avoid content cutting off, when a PDF is generated"@xml.fieldname.sectionnodename. 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 sizedrownodename. You will also notice columns between sections do not aligncolumnodename. To fix thisnodevalue@", we will use CSS in a SmartFolder and amend our '''Read Only 2))-- System Variable''', which is displaying the XML information.></pre>
Wrap the content in your read only system variable with * Extract a div percentage value and give the div '''format with two decimal places'''. If pulled from a class. We do this to control the width. Wrap the '''dynamic''' XML section syntax in a div and give it a class. We do this so we can control the size of cells and the fontsthen you will see multiple values. Example:
<pre><div class="xml700"><div class="xmlTitleBar">Title Bar Name</div><div class="xml3col">@xml.fieldname.sectionnodename.htmlrownodename[# ~percentdisplay(columnodename.nodevalue,2)~ #]@</div></div></pre>
Now create a CSS file. Example:* Extract date values and return with specific formatting using the following syntaxReturn the date in the user's date format
<pre>@charset "utf-8";/* CSS Document */.LeftAlign {text-align:left;}.RightAlign {text-align:right;} <!--Used to align numbers like money to the right-->.xml700 {width:700px;} <!--Used to constrain the xml and title bars to 700px-->.xml3col .xmlHead {font-size:12px;} <!--Used to change the header font size-->.xml3col .xmlLabel {width:470px; min-width:470px; max-width:470px; font-size:12px;} <!--Used to set the first column to a set size and change the font size-->.xml3col fieldname.xmlCell {width:80px; min-width:80px; max-width:80px; font-size:12px} <!--Used to set the rest of the columns to a set size and change the font size-->sectionnodename.xml3col rownodename.xmlCellformatdate(columnnodename.note {width:150px; min-width:150px; max-width:150px; font-size:12px} <!--Used to set one column to a larger size than the other cells-->nodevalue)@</pre>
Go to * Return the desired SmartFolders and upload your CSS fileyear. Use '''View URL''' to get the path to the CSS file. Then add the relative link back into your '''Read Only - System Variable'''. Example:
<link href="/files/427076/f114840/filenamepre>@xml.fieldname.sectionnodename.year(columnnodename.css" rel="stylesheet" type="text/css" nodevalue)@</pre>
Add * Return the class '''RightAlign''' to the desired cells in the section buildermonth.
If you want to make one cell larger than the others, add a custom class to that cell in the section builder Example:<pre>@xml.fieldname.sectionnodename.month(columnnodename.nodevalue)@</pre>
<pre>* Return the month name.xml3col .xmlCell.note {width:150px; min-width:150px; max-width:150px; font-size:12px}</pre>
I can add '''note''' to a cell that has xmlCell in a section wrapped in a div with a class '''xml3col''' and that cell will become 150 pixels wide<pre>@xml.fieldname.sectionnodename.monthname(columnnodename.nodevalue)@</pre>
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”)* Return the day.
==== Using different styles for Print and Web with XML ====<pre>@xml.fieldname.sectionnodename.day(columnnodename.nodevalue)@</pre>
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 * Return 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 day of 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 bothweek.
=== Reporting on a XML ===Extract XML value in a report using the following syntax in the report builder. This will return one value for static XML sections specific to the row and multiple values for Dynamic XML sections across all rows.<pre>ExtractValue@xml.fieldname.sectionnodename.dayweek([this], '/worksheet/sectionnodename/rownodename/columnnodename'.nodevalue)@</pre>
== * Count the number of rows the user created in a dynamic XML - Appendix ==section.
=== Field options and settings ===<pre>@xml.fieldname.sectionnodename.rownodename.nodecount@</pre>
==== General Settings ====* Return the XML feed (code) from the field.
'''Custom Field ID''': Used internally to reference the user's input<pre>@fieldname.xmlvalue@</pre>
'''Field Type''': Used to select the field type from list of available field types* Return multiple rows for XML with dynamic sections.
'''Field Name''': Used internally to reference the user's input<pre>@xml.fieldname.sectionnodename.rownodename[# ~columnnodename.nodevalue~ #]@</pre>
'''Description''': Used * Return Filtered row values for a general description, this field only appears on the configuration pageXML with dynamic sections.
'''XSL Template''': Used to define how the XML will look<pre>@xml.fieldname.sectionodename.rownodename[#(?criteria="~colunnnodename.nodevalue~" == "matching criteria")~columnnodename.nodevalue~ #]@</pre>
'''* Return multiple rows for XML Tag Mapping''': Used to Tag Mapswith dynamic sections in a custom html table.
'''XML Javascript Function''': Used for JavaScript and jQuery functions such as validations<pre>@xml.fieldname.sectionnodename.rownodename[# #]@</pre>
'''Show View XML Button''': Used to display the XML button{| border="1"|-||~columnodename. This button opens the xml feed (code) in a new windownodevalue~||~columnodename.nodevalue~||~columnodename.nodevalue~|}
'''Show Upload Button''': Used to display * Return a single value in the upload button. This button enables the user to upload an total row of a Dynamic XML, and if the node structure matches that of the field, it will populate the cells with the correct values.
'''Show Up/Down Button''': Used to display an up and down arrow on each row of a dynamic XML section<pre>@xml.fieldname.sectionnodename.total. Enabling the user to move rows up and downcolumnnodename.nodevalue@</pre>
'''==Styling Advanced Data Table for web, print and conversion to PDF==[[File:xml-readonly-styled.png|500px|border|The worksheet styled at 700 pixels wide in a Display fields refreshed upon edit''': Displays the ID of Text and Variables custom fields that reference this field. When this field is modified the references will automatically update.]]
To ensure data entered into an '''Custom Field IdsAdvanced Data Table''': Used fits on screen and will converted to reduce variable processing time. Specify field ids a PDF without having data cut off, administrators need to upload two external CSS style sheet to a SmartFolder, reference it on the '''Advanced Data Table''' and the '''Display Text and Variables''' fields as well as add some code to both of custom these fields referenced from within the current field.
Note:
==== Display ====# Make sure your Advanced Data Table has 8 or less columns to ensure it will print and fit on screen.# If the user is expected to enter paragraphs of information, do so in a new row or new section, instead of adding another column.# If your worksheet does not look as expected make sure '''Apply Default Styles''' is toggled on in the '''Section Builder''' and then click '''Build''' on each of your sections in the section builder.
'''Display Order''': Used to define where this field appears relative to other fields. Lower numbers appear closer to the top of the page.
===Styling the Advanced Data Table for viewing onscreen===Ensure the columns and rows of your '''Tab NameAdvanced Data Table''': Used to display look good onscreen, when a user enters information, by following the field under a specific tabsteps below.
====Uploading the external CSS files and getting the relative links====# Download the CSS files [[File:CSS.zip|CSS.zip]]# In your desired instance navigate to the Menu Icon and choose '''SmartFolders'''# If it does not exist already create a '''New Folder''' and call it '''System Files'''# Upload the CSS files found inside the Zip file you downloaded in step 1# Inside SmartFolders in the column called '''File Options''' for the desired file select '''View URL'''Captionfrom the drop down. This will give you the absolute path to the file you uploaded# Copy this link that starts with '''https: Used ''' and ends with '''/CSS_for_XSL_onscreen_1290.css'''.# Remove the first part of the link before the '''/files...''' to make it a relative link. Absolute links can have an adverse affect on your instance and they won't work as expected on your backup. So Always convert the absolute link to a relative link. Your relative link will look like '''/files/000000/f000000/CSS_for_XSL_onscreen_1290.css'''# Save this relative link in a label or question before the text file so we can add it to each '''Advanced Data Table''' custom fieldin your instance. If left blank, # Repeat steps 5 to 8 for the Field Name second CSS file which will be displayed as used for rendering on the object and in the captionPDF.
====Modifying the Advanced Data Table template====# Download the templates used for the '''Caption LocationAdvanced Data Table'''and the '''Display Text and Variables''' fields [[File: Used TEMPLATES.zip]].# In the desired '''Advanced Data Table''' Field paste the content from the xsl_template_1290 file you downloaded, into the XSL Template input.# Change the href in the link to the relative URL that points to the CSS file you previously uploaded to the SmartFolder (Example href="/files/000000/f000000/CSS_for_XSL_onscreen_1290").# Update the text called '''Title''' in two places inside the XSL template.# Update '''@section.Section Node Name@''' with the '''Section Node Name''' you want to control display.# Modify the class wrapper with the position and visibility amount of columns in your section. Example '''class="xml6col"''' is for a 6 column section. If you have 2 columns, change it to '''class="xml2col"'''.# Save the captionAdvanced Data table Field. See examples [[Label_Display_Options]]
'''Instructions''': Used Now when you click the button to display text in the caption area. Instructions appear below open the caption Advanced Data Table you will see your columns will render nicely and are always visible unlike tool tips that appear on mouse overthey will be equal in width.
'''Button Label'''Note: Used to specify the text that appears on the button. You can also specify an icon.
# Under Display you can customize the Button Label. To meet with Accessibility guidelines you must change the button label from '''Tool TipOpen''': Used to display a text message when the something meaningful like '''Modify Budget'''. The user hovers over must know what the question mark. These messages are intended to assist button will do based on the user in filling text in the desired fieldbutton.You cannot have a generic link that says '''open''' or '''On New Recordclick here''': Used as that does not provide enough information when read out of context by a screen reader.# Sections must contain 8 or less columns to control when the field should render properly and be displayedusable.
===Styling Advanced Data Table for Converting to PDF and Printing===
You can print your Advanced Data Table content by displaying it in a '''Display Text and Variables''' custom field. In order to do this the content must fit within 700 pixels wide (portrait) or 900 pixels wide (landscape) otherwise content will cut off when a PDF is generated. To ensure content does not cut off and to ensure columns between sections align, we will use CSS in a SmartFolder and amend our '''Display Text and Variables''' custom field.
# Navigate to the desired '''Display Text and Variables'''.# Paste the contents of '''display.html''' into the '''Content''' section of the field.# update the href to point to the relative path to the file called '''xml-print.css''' that you uploaded to the SmartFolders.# Add your desired variable example '''@xml.Budget.Expenses.html@''' inside the div with the '''class="xml8col"'''.# Change the '''8''' in '''class="xml8col"''' to the number of columns in your section. Note you must have 8 or less columns.# If you want this table to be displayed wider for landscape printing add the word '''landscape''' in the class example '''class== Options ===="xml8col landscape"'''. # Save your custom field
You now have a version of your Advanced Data Table that you can display on the object such as the level 1 application and you can convert this to a PDF using the Web Page View custom field.
If you created two '''Appear MandatoryDisplay - Text and Variables''': Used custom fields one for printing and one for onscreen. The above instructions are for the print version as it will reduce the font size and constrain the content to make 700 pixels. In this print version use the setting '''SmartFields View''' and choose '''Include'''. This will include this field look like it is required without doing validationin the PDF. On the second '''Display - Text and Variables''' intended for on screen use '''SmartFields View''' and choose '''Exclude'''. This is used in conjunction with other validation methods such as SmartCheck, Submit Logic will hide the onscreen version from the PDF. Lastly for the onscreen version you do not use the xml-print.css or Browser Scriptthe div wrappers.
'''Track Changes''': Used to log changes to ==Reporting on Advanced Data Table data==Extract values in a report using the field example: who updated following syntax in the field when and what was report builder. This will return one value for static sections specific to the new row and old multiple valuesfor Dynamic sections across all rows.
'''Enable Builder''': Used to create sections, define rows, columns, formulas and styles in your XML. '''<pre>ExtractValue([[KML|Enable KML]this], ''': Used to upload a KML file which is used to display geographic data on a map. '''Disable Field from Global Search''': Used to control the display of this field in the global search results.  ==== Value Storage ==== '''Value Storage''': Used to save values to another field on the same entity. === Example of XML field === Here is an example of an XML field with one section (Expenses) 3 static rows (Salaries, Supplies and Total) and 3 columns (Amount, Notes and Date). <pre><?xml version="1.0" encoding="UTF-8"?></worksheet> <Expenses> <Salaries> <Amount>50000</Amount> <Notes>People I work with<sectionnodename/Notes> <Date>2016-11-30<rownodename/Date> </Salaries> <Supplies> <Amount>30000</Amount> <Notes>Things I need</Notes> <Date>2016-11-30</Date> </Supplies> <Total> <Amount>8000</Amount> <Notes></Notes> <Date>2016-11-30</Date> </Total> </Expenses></worksheet>columnnodename')</pre>
{{CustomFieldPageFooter}}
[[Category:XML]]
Smartstaff, administrator
3,315
edits

Navigation menu