Having a hard time invoking the currentRecord.get(...
# suitescript
j
Having a hard time invoking the currentRecord.get() method. Any obvious reasons why?
Copy code
/**
 * @NApiVersion 2.1
 * @NScriptType UserEventScript
 */
define(['N/currentRecord', 'N/search'],
    (currentRecord, search) => {
        const beforeLoad = (scriptContext) => {
            
            log.debug({title: 'Before Load Fired', details: 'Before Load Fired'})
            const context = scriptContext.type;
            log.debug({title: 'Context Type', details: context})
            const record = currentRecord.get() // Not able to call current record
            const recid = record.id
            log.debug({title: 'Record ID', details: recid})
        }
        return {beforeLoad}
    });