Overview
This type can store HTML code. It will show a nice text editor in edit mode and will render in HTML in read-only mode.
One important thing to keep in mind is that for security reasons HTML code will be stripped. These tags are allowed:
<a href="ftp|http|https|mailto" title="">
<b>
<blockquote cite="http|https">
<br>
<caption>
<cite>
<code>
<col span="" width="">
<colgroup span="" width="">
<dd>
<div>
<dl>
<dt>
<em>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<i>
<img align="" alt="" height="" src="http|https" title="" width="">
<li>
<ol start="" type="">
<p>
<pre>
<q cite="http|https">
<small>
<strike>
<strong
<sub>
<sup>
<table summary="" width="">
<tbody>
<td abbr="" axis="" colspan="" rowspan="" width="">
<tfoot>
<th abbr="" axis="" colspan="" rowspan="" scope="" width="">
<thead>
<tr>
<u>
<ul type="">
<span>
<div>
<hr>
Appart for thos specific attributes, class
is allowed for all tags.
Available features
Name | Supported | Notes |
---|---|---|
Many multiplicity |
yes |
|
Default values |
yes |
|
Unique flag |
yes |
|
Required flag |
yes |
|
Indexable flag |
yes |
|
Sensitive flag |
yes |
|
Calculated value |
yes |
|
Automatic initialization |
no |
|
Calculated initial value |
no |
|
Aggregation |
no |
|
Default type rules |
no |
|
Default display options |
yes |
|
Type rules
Display options
Limit number of characters
This will limit the number of characters to display, showing a More
button to expand the content.
Keep in mind that this option only has effect when the field is read-only.
REST API
Read format
The format is the plain HTML code:
"notes": "<p>test <span style=\"background-color: yellow; font-weight: bold;\">html</span> text</p>"
Write format
You should pass HTML code:
"notes": "<p>test <span style=\"background-color: yellow; font-weight: bold;\">html</span> text</p>"
Keep in mind that HTML code sent will be stripped out as explained above in the overview.
Javascript API
Read format
The val()
method in the wrapper will return a plain HTML code:
// this will print something like "<p>test</p>"
log('notes: '+record.field('notes').val());
Write format
You should pass a plain string to set the value:
record.field('notes').val('<p>test <span style="background-color: yellow; font-weight: bold;">html</span> text</p>');
Keep in mind that HTML code sent will be stripped out as explained above in the overview.
Wrapper
Export/Import
Export format
The export format is a string with the HTML code:
"htmlField"
"<strong>title</strong><p>blah blah</p>"
Import format
The import format is a string with the HTML code:
"htmlField"
"<strong>title</strong><p>blah blah</p>"
Queries
Please check the documentation for Query language for more information.
Available operators
Operator | Supported | Notes |
---|---|---|
equals |
yes |
|
notEquals |
yes |
|
empty |
yes |
|
notEmpty |
yes |
|
like |
yes |
|
greater |
yes |
|
greaterOrEquals |
yes |
|
less |
yes |
|
lessOrEquals |
yes |
|
between |
yes |
|
currentUserField |
no |
|
Query formats
You should pass the text as a plain HTML. For example:
// finds companies where notes have the word 'test'
var records = sys.data.find('companies', {'notes': 'like(test)'});
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
// finds companies where notes have the word 'test'
var query = sys.data.createQuery('companies')
.field('notes').like('test');
var records = sys.data.find(query);
log('total: '+records.count());
while (records.hasNext()) {
log(records.next().label());
}
finds companies where notes have the word 'test'
GET /data/companies?notes=like(test)
There is one important thing to keep in mind. Searches will be done against the plain text version of the field.
For example if you have a tag with a class name test
, the query above will not match it because it is not part
of the visible text of the HTML.
Aggregate queries
Please check the documentation for Aggregate queries for more information.
Available operators
Operator | Supported | Notes |
---|---|---|
sum |
no |
|
avg |
no |
|
first |
yes |
|
last |
yes |
|
min |
yes |
|
max |
yes |
|
UI queries
Please check the documentation for UI queries for more information.
Matching of values
Property | Description |
---|---|
Matching operator |
|
Special values |
Available operators
Operator | Supported | Notes |
---|---|---|
Many values |
yes |
|
Greater |
no |
|
Greater or equals |
no |
|
Less |
yes |
|
Less or equals |
yes |
|
Between |
no |
|