Can anyone tell me why i am getting a loop on this...
# suitescript
k
Can anyone tell me why i am getting a loop on this?
Copy code
function fieldChanged(scriptContext) {
    	var currentRecord = scriptContext.currentRecord;
    	function changeToCaps(scriptContext) {
    		if (scriptContext.fieldId === 'custrecord_itemsupplier_suppliercode') {
    		var preCaps = currentRecord.getValue({fieldId: 'custrecord_itemsupplier_suppliercode'});
    		var afterCaps = preCaps.toUpperCase();
    		currentRecord.setValue({fieldId:'custrecord_itemsupplier_suppliercode', value: afterCaps});
    		}
    	}