Product Update

Require a Minimum Number of Attachments

Carlyn Manly
2019-06-19

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
Ā Ā }
});