Product Update

Require a Minimum Number of Attachments

Carlyn Manly
2019-06-19
1 Min Read

Xurrent UI extensions now provide the ability to determine the number of files that are attached to aΒ record before this record is saved. This can be accomplished with the following JavaScript in aΒ UIΒ extension:

ITRP.field(β€˜attachment’).size()

The JavaScript example below prevents someone in Xurrent Self Service from submitting a request without adding at least 3 attachments:

$(β€˜#save’).on(β€˜click’, function(e) {
Β Β if (ITRP.field(β€˜attachment’).size() < 3) {
Β Β Β Β // at least 3 attachments
Β Β Β Β e.stopImmediatePropagation();
Β Β Β Β // prevents save action
Β Β Β Β // do something, show alert or error message
Β Β }
});