Hi Experts, Deployed a client script on purchase o...
# integrations
n
Hi Experts, Deployed a client script on purchase order and sales order and it's throwing exception. Log.error is not a function.
c
Have you checked the basics? What have you aliased N/log as?
(I note the capital 'L')
a
Hi @CD Here is the code: /** * @NApiVersion 2.x * @NScriptType ClientScript * @NModuleScope SameAccount */ define(['N/ui/message', 'N/record', 'N/currency', 'N/runtime', 'N/log'], function(msg, record, currency, runtime, log) { function pageInit(scriptContext) { try { alert('Working'); try { log.debug('Working'); } catch(e) { log.error({title: 'pageInit Exception',details: e.message}); } } catch(e){ console.log('Exception', e.message); } } return { pageInit: pageInit }; });
We are facing this error:
c
How is it deployed? If it's form level, log won't work
a
It is deployed on the Purchase Order record.
m
Should that be 'message' instead of 'msg' being defined?
define(['N/ui/message', 'N/record', 'N/currency', 'N/runtime', 'N/log'], function(message, record, currency, runtime, log) {