Validation Feedback Javascript

0
Hi Forum,   Is there a way to implement Validation Feedback into a Javascript action?
asked
1 answers
3

Dear BS Support,

Yes you can

https://apidocs.rnd.mendix.com/8/client/mendix_lib_ObjectValidation.html

A Sample from mx 8.10.1

/**
 * @param {MxObject} inputObject
 * @param {string} attribute
 * @param {string} message
 * @returns {Promise.<void>}
 */
export async function JSA_Validate(inputObject, attribute, message) {
	// BEGIN USER CODE
	let validation = new mendix.lib.ObjectValidation(inputObject.getGuid(), {[attribute]: message});
	mx.data.sendValidationUpdates([validation]);
	// END USER CODE
}

Please be aware the sendValidationUpdates is undocumented, and therefore unsupported and is subject to change.

Though why are you not using the Nanoflow Validation Feedback action?

Cheers, Andries

answered