Changes

Jump to: navigation, search
no edit summary
By default, the data for this field is stored in the structured XML (Extensible Markup Language) format. However, you also have the option to instead use this field as a presentation layer for lists of 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.
If you are looking to create a basic list or budget, you can also use the field called '''[[Custom Field Type: Special - In-Line Basic Data GridTable|Special - In-Line Basic Data GridTable]].'''
{| class="wikitable"
{{Show Clear Button}}
 
{{Display fields refreshed upon edit}}
{{Custom Field Ids}}
=Configuration - Essentials=
==Creating the field==
Typically XML Advanced Data table custom fields are created for UTA level 1, 2 or 3, (e.g. a grant application) or they are created for organizations. To create the field:
# Navigate to the desired settings area where you want to create a worksheet (e.g. the UTA level 1).
==Adding a formula to a cell (working with data in the same section)==
 
# Navigate to your custom field.
# Click the '''Section Builder''' button in the action bar.
So if you wanted to add the values of row 1 and 2 together in column 1 you would enter '''=[1,1]+[2,1]'''.
 
To minimize divide by zero errors, you can first check if the denominator is 0 (and set value to 0) by using the following syntax:
 
<pre>=(ssParseNum([1,3])==0 ? 0 : ([1,2]/[1,3])*100)</pre>
==Adding a formula to a cell (working with data in the different sections)==
e.g. '''=[@section.''expense''.id@_''Total_Amount'']-[@section.''income''.id@_''Existing-funds''_''Amount'']'''
 If you need want to display data in the head of a section (row 0) from another section you can use the following: '''@xml.customfieldname.sectionnodename.rownodename.columnnodename@''' ==Validate XML 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.
<pre>parseInt([this])>0</pre>
Message: Please provide a numeric value greater than 0.
 
 
 
* Value entered in one cell cannot be more than 20% above or below the value in another cell
 
<pre>(ssParseNum([this])>=(ssParseNum([1,4])*(0.80)) && ssParseNum([this])<=(ssParseNum([1,4])*1.20))</pre>
Message: Value entered in one cell cannot be more than 20% above or below the value in another cell
==Validating values when saving record (SmartCheck, Submit Logic, Browser Script)==
In addition to validating values when you save the XML worksheet you can also validate the XML worksheet when you save the record (e.g. save a level 1 grant application).
When creating validation for an XML this custom field use the '''Appear Mandatory''' option. Appear mandatory does not enforce the validation but will make the field look mandatory (add it adds the asterisk and or color) just like the mandatory option. Once you have checked '''Appear Mandatory''', validate the XML worksheet this field 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.
Validate an XML a table node is not empty and display a message.
<pre>if("@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@"=="")
===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>"@level1.xml.fieldname.sectionnodename.rownodename.columnnodename.nodevalue@"!=""</pre>
</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 1
var 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 2
var 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 3
var 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>
 
The following allows you to hide the Add Row button for a specific section when the record is in a specific status:
<pre>function onloadfunc() { <!--@sslogic("@statusid@" ==Managing Level 2 "XXXXX" )--> //Replace XXXXX with the ID of the status in which the button should be hidden $('#addrowbutton_@section.SECTION.id@').hide(); // 3 Activities Replace SECTION with an XML Section==the section name <!--@end-->System administrators can configure XML fields to add, modify or delete {{l2}} records on a {{l1}} entity or {{l3}} records on a {{l2}} entity.</pre>
The following allows you to hide the Delete Row button: <pre>function onloadfunc() { $("a[name='@section.SECTION.id@_deletebutton']").remove(); //Replace SECTION with the section name}</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 [[XML '''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]]
When '''Enable Mapping''' is selected, you can choose one type of activities to be referenced by the XML this field.
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 the XMLthis field. The custom fields used have to be those fields with pre-defined options (e.g. [[Custom Field TypeCustom_Field_Type: _Select_One_-_Dropdown_List|Select One – Combo Box|Combo box- Dropdown List]], and [[Custom Field TypeCustom_Field_Type: _Select_Many_–_Check_Boxes|Select Many – Check Boxes|Check Boxes]], [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control]], Ajax Lookup).
[[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 XML 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]], simply the field name (i.e., '''Fund Name''');* for [[standard fieldStandard_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.
When this section is added to the XSL Template of your XML field, the list of {{l2}} activities will be displayed when the XML worksheet is opened. Level 2s can be added, deleted and modified directly from the {{l1}} XML Advanced Data Table field.
=Displaying XML Data=
==Displaying XML Advanced Data Table data on an object==
[[File:xml-readonly.png|500px|border|The XML displayed in a read only]]
The XML Advanced Data Table custom field opens can open in a new or modal window and . 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 must click clicks a button . But there is a way to launch the modal window and see the information entered. You can however, display the information entered into a '''Special - XML Data''' custom this 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  Use the '''Read Only – System Display - Text and Variables''' custom fieldto display the content of the Advanced Data Table on the object. The same syntax can be used elsewhere in the system (e.g. include Display Only - Web Page View, Special MS Word Merge, visibility conditions, etc.) when referencing the xml this field's 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).
Note: you may want to create two '''Display - Text and Variables''' custom fields for 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 XML Data==The syntax options for accessing, displaying and formatting the data from the XML fields are Advanced Data Table field is detailed below.
<pre><!--@sscalculation(format("@xml.fieldname.sectionnodename.rownodename.columnodename.nodevalue@",2))--></pre>
 
* Extract a filtered row count from a '''dynamic''' XML section.
 
<pre><!--@sscalculation(@xml.XML Field.People.Person[#(?criteria="~type.nodevalue~" == "A") 1+#]@ 0)--></pre>
* Extract a percentage value and '''format with two decimal places'''. If pulled from a '''dynamic''' XML section then you will see multiple values.
* Return multiple rows for XML with dynamic sections in a custom html table.
<pre>@xml.fieldname.sectionnodename.rownodename[# #]@</pre>
{|border="1"
|-
||~columnodename.nodevalue~
* Return a single value in the total row of a Dynamic XML.
<pre>@xml.fieldname.sectionnodename.rownodename.total.columnnodename.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 Text and Variables custom field]]
==Styling XML To ensure data for web entered into an '''Advanced Data Table''' fits on screen and print (will converted to a PDF)==[[File:xml-readonly-styledwithout 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 these fields.png|500px|border|The XML styled at 700 pixels wide in a read only]]
If you enable the '''Section Builder''' and '''Apply Default Styles''' is enabled 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.Note:
Administrators with CSS knowledge can modify the look # Make sure your Advanced Data Table has 8 or less columns to ensure it will print and feel of their XMLs (e.g. make columns wider or thinner)fit on screen. To modify # If the look and feel user is expected to enter paragraphs of your XMLinformation, create an external CSS style sheet, upload the style sheet to do so in a SmartFoldernew row or new section, add classes to the elements instead of adding another column.# If your worksheet does not look as expected make sure '''Apply Default Styles''' is toggled on in your XML, and add a link to the style sheet in your '''Special - XML DataSection Builder''' or and then click '''Read Only - System VariableBuild''' custom fieldson each of your sections in the section builder.
===Styling the Advanced Data Table for viewing onscreen===
Ensure the columns and rows of your '''Advanced Data Table''' look good onscreen, when a user enters information, by following the steps below.
===Styling XML Data for Printing=Uploading the external CSS files and getting the relative links====You can print # Download the CSS files [[File:CSS.zip|CSS.zip]]# In your XML if you are displaying desired instance navigate to the Menu Icon and choose '''SmartFolders'''# If it in does not exist already create a '''Read Only - New Folder''' and call it '''System VariableFiles'''# 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''' from the drop down. Size your your XML This will give you the absolute path to fit within 700 pixels wide (portrait) or 900 pixels wide (landscape) the file you uploaded# Copy this link that starts with '''https:''' and ends with '''/CSS_for_XSL_onscreen_1290.css'''.# Remove the first part of the link before the '''/files...''' to avoid content cutting off, when make it a PDF is generatedrelative link. If you Absolute links can have more than one section an adverse affect on your instance and more than they won't work as expected on your backup. So Always convert the absolute link to a few columns, some of your content may cut off when printed if it is not sizedrelative link. You Your relative link will also notice columns between sections do not alignlook like '''/files/000000/f000000/CSS_for_XSL_onscreen_1290. To fix css'''# Save this, we will use CSS relative link in a SmartFolder and amend our text file so we can add it to each '''Read Only - System VariableAdvanced Data Table''', custom field in your instance.# Repeat steps 5 to 8 for the second CSS file which is displaying will be used for rendering on the XML informationobject and in the PDF.
Wrap ====Modifying the Advanced Data Table template====# Download the templates used for the '''Advanced Data Table''' and the '''Display Text and Variables''' fields [[File: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 your read only system variable with a div and give the div a class. We do this link to the relative URL that points to the CSS file you previously uploaded to control the widthSmartFolder (Example href="/files/000000/f000000/CSS_for_XSL_onscreen_1290"). Wrap # Update the text called '''Title''' in two places inside the XSL template.# Update '''@section syntax .Section Node Name@''' with the '''Section Node Name''' you want to display.# Modify the class wrapper with the amount of columns in your section. Example '''class="xml6col"''' is for a div and give 6 column section. If you have 2 columns, change it a to '''class="xml2col"'''. We do this so we can control the size of cells and # Save the fonts. e.gAdvanced Data table Field.
<div class="xml700"><div class="xmlTitleBar">Title Bar Name</div><div class="xml3col">@xml.fieldname.sectionnodename.html@</div></div>Now create a CSS file. e.gwhen you click the button to open the Advanced Data Table you will see your columns will render nicely and they will be equal in width.
<pre>@charset "utf-8";/* CSS Document */.LeftAlign {text-alignNote:left;}.RightAlign {text-align:right;}.xml700 {width:700px;}.xml3col .xmlLabel {width:470px; min-width:470px; max-width:470px;}.xml3col .xmlCell {width:80px; min-width:80px; max-width:80px;}.xml3col .xmlCell.note {width:150px; min-width:150px; max-width:150px;} </pre>
Go to # Under Display you can customize the desired SmartFolders and upload your CSS fileButton Label. Use To meet with Accessibility guidelines you must change the button label from '''View URLOpen''' to get something meaningful like '''Modify Budget'''. The user must know what the button will do based on the path to text in the CSS filebutton. Then add the relative You cannot have a generic link back into your that says '''open''Read Only - System Variable'or '''click here''' as that does not provide enough information when read out of context by a screen reader. e.g# Sections must contain 8 or less columns to render properly and be usable.
Add the class ===Styling Advanced Data Table for Converting to PDF and Printing===You can print your Advanced Data Table content by displaying it in a '''RightAlignDisplay Text and Variables''' custom field. In order to do this the desired cells in the section buildercontent must fit within 700 pixels wide (portrait) or 900 pixels wide (landscape) otherwise content will cut off when a PDF is generated.If you want To ensure content does not cut off and to make one cell larger than the othersensure columns between sections align, add we will use CSS in a SmartFolder and amend our '''Display Text and Variables''' custom class to that cell in the section builder e.gfield.
<pre># Navigate to the desired '''Display Text and Variables'''.xml3col # Paste the contents of '''display.xmlCellhtml''' into the '''Content''' section of the field.note {width:150px; min# update the href to point to the relative path to the file called '''xml-width:150px; max-width:150px; font-size:12px}</pre>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="xml8col landscape"'''.# Save your custom field
I You now have a version of your Advanced Data Table that you can add '''note''' display on the object such as the level 1 application and you can convert this to a cell that has xmlCell in a section wrapped in a div with a class '''xml3col''' and that cell will become 150 pixels widePDF using the Web Page View custom field.
Note: your cells must add up If you created two '''Display - Text and Variables''' 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 700 pixels if you are displaying your budget . In this print version use the setting '''SmartFields View''' and choose '''Include'''. This will include this field in a portrait the PDF . On the second '''Display - Text and Variables''' intended for on letter size paper (8screen use '''SmartFields View''' and choose '''Exclude'''. This will hide the onscreen version from the PDF. Lastly for the onscreen version you do not use the xml-print.5 x 11”)css or the div wrappers.
  ===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. ==Reporting on XML Advanced Data Table data==Extract XML value values 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([this], '/worksheet/sectionnodename/rownodename/columnnodename')</pre>
 
==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"?-->
 
50000
People I work with
2016-11-30
30000
Things I need
2016-11-30
8000
2016-11-30
</pre>
{{CustomFieldPageFooter}}
[[Category:XML]]
Smartstaff
34
edits

Navigation menu