Property Value Length and Limits
Limits are applied to property values that are submitted by the plug-in through the Plugin API for update. If a value length exceeds the limit, Oracle Field Service returns an error message as part of the message with the error method.
Fields (property type is 'field')
Maximum un-formatted data to store is 239 bytes. JavaScript uses UTF-16 for strings, so one Unicode character may take up 2 to 4 bytes. But, the String.length property uses UTF-16 code points for counting, which is 2 bytes. This means, the length of the string containing one 4-byte UTF-16 char is 2. So, only ceil(239/2) = 119 code points can be stored without truncating.
Signatures (property type is 'file' and GUI option is 'Signature')
We assume that the value contains only MIME-type and correct base64 string. So, each character takes up 2 bytes as JavaScript uses UTF-16. To avoid overflow of LocalStorage, each signature is limited with 200 KB (1024*200/2 = 102400 characters).
File Properties (property type is 'file' and GUI is not 'Signature')
Maximum allowed length for a file property value depends on the "File size limit" attribute configured for the property, but it can't exceed 20 MB (20971520 bytes) in any case.
Properties (any other property type)
function isPropertyLengthValid(value) {
if (('' + value).length <= }}{{21845) {
return true;
}
if (('' + value).length > }}{{65535) {
return false;
}
var utf8Encoder = }}{{new TextEncoder();
var utf8BytesArray = utf8Encoder.encode(value);
utf8Encoder = }}{{null;
if (utf8BytesArray.length <= }}{{65535) {
return true;
}
return false;
}
File Properties
fileName: Name of the file, that will be shown on the Oracle Field Service user interface
fileContents: Blob object that contains the file contents. It can be constructed and filled with the data generated by JS code in runtime, or just obtained from the file input and sent to Oracle Field Service Core Application without any transformation, as the File object inherits the Blob.
Length of the file must be less than or equal to the configured File size limit
MIME type of the file must be equal to one of the configured Allowed MIME types