ericbirdsall
09/26/2021, 5:30 PMericbirdsall
09/26/2021, 5:33 PM/**
* @NApiVersion 2.1
* @NScriptType ClientScript
* @NScriptName So confused!
*/
define([], function () {
/**
* 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) {
console.log('test');
console.log(scriptContext);
}
return {
pageInit: pageInit
};
});
When the API Version is set to 2.1, the console prints:
'test'
'create'
When the API Version is set to 2.0, the console prints:
'test'
Object { currentRecord: {…}, mode: "create" } (as expected)
battk
09/26/2021, 5:59 PMbattk
09/26/2021, 5:59 PMericbirdsall
09/26/2021, 6:00 PMbattk
09/26/2021, 6:04 PMbattk
09/26/2021, 6:05 PMericbirdsall
09/26/2021, 6:12 PMericbirdsall
09/26/2021, 6:12 PMWatz
09/26/2021, 7:34 PMstalbert
09/28/2021, 5:03 AM