Jira Code: CPH-3
Open the phone call pop up with field pre filled data, so that we have the option to edit the person who follows up or cancel the phonecall if we like.Also add the quote in the related records of Phone call record
Client Script: CPH-3 JJ CS Set Organizer in Phone call
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define(['N/record'],
function(record) {
/**
* Function to be executed after page is initialized.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.currentRecord - Current form record
* @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
*
* @since 2015.2
*/
function pageInit(scriptContext) {
try{
if ((scriptContext.mode == 'create') || (scriptContext.mode == 'edit')) {
var currentRecord = scriptContext.currentRecord;
var proposalId = currentRecord.getValue({
fieldId: 'custevent_proposal'
});
if(proposalId){
var proposal = record.load({
type: record.Type.ESTIMATE,
id: proposalId,
isDynamic: true,
});
var saleRep = proposal.getValue({
fieldId: 'salesrep'
});
currentRecord.setValue({
fieldId: 'assigned',
value: saleRep
});
}
}
}catch(er){
log.error('error',er)
}
}
return {
pageInit: pageInit
};
});