This is similar, and I have this working on my account.
define(['N/currentRecord'],
function(currentRecord, dialog, log) {
/**
*
* @NApiVersion 2.0
* @NScriptType ClientScript
*/
function saveRecord (){
var objRecord = currentRecord.get();
var costcentre = objRecord.getValue({
fieldId: 'entityid' })
objRecord.setValue({
fieldId: 'externalid',
value: costcentre,
});
return true;
}
return {
saveRecord: saveRecord
};});