XMLElementIterator - hasNext()

Determines if there is another element available.

This method is available only in an Edge Encryption rule action script.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Boolean True if another element is available.

This example is from the List Edit encryption rule.

function ListEditAction(request) {
	var xmlContent = request.postParams.sysparm_xml.getAsXmlContent();
	for (var xmlElementIter = xmlContent.getIterator('record_update'); xmlElementIter.hasNext(); ) {
		var xmlElement = xmlElementIter.next();
		var tableName = xmlElement.getAttributeValue('table');
		for (var xmlRecordIter = xmlElement.getIterator('record'); xmlRecordIter.hasNext(); ) {
			var xmlRecord = xmlRecordIter.next();
			for (var xmlFieldIter = xmlRecord.getIterator('field'); xmlFieldIter.hasNext(); ) {
				var xmlField = xmlFieldIter.next();
				var fieldName = xmlField.getAttributeValue('name');
				for (var childIter = xmlField.getIteratorOverAllChildren(); childIter.hasNext(); ) {
					var childElement = childIter.next();
					childElement.valueFor(tableName, fieldName);
				}
			}
		}
	}
}