The fieldChanged function after the field is “unfocused” or in a simpler term – updated.
Some users get stuck to certain fields they click such as the start date field or item field on the item sublist of transaction records. This is usually caused by a missing return true; statement within the fieldChanged function of a client script.
Here is a sample that you can try out:
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define([],
function() {
/**
* Function to be executed when field is changed.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.currentRecord - Current form record
* @param {string} scriptContext.sublistId - Sublist name
* @param {string} scriptContext.fieldId - Field name
* @param {number} scriptContext.lineNum - Line number. Will be undefined if not a sublist or matrix field
* @param {number} scriptContext.columnNum - Line number. Will be undefined if not a matrix field
*
* @since 2015.2
*/
function fieldChanged(scriptContext) {
var fieldId = scriptContext.fieldId;
alert(fieldId);
return true;
}
return {
fieldChanged: fieldChanged
};
});
Do you have any feedback? Let us know in the comments!