This message was deleted.
# suitescript
s
This message was deleted.
c
I was going to suggest the exact changes you made from your original post in the general channel.
Can you share the UE script?
v
sure
define([ 'N/ui/serverWidget', //'CMB_cs_pfa_functions', 'N/url' ], function(serverWidget,url){ function beforeLoad(context){ var newRecord = context.newRecord; var newRecordId = newRecord.id; var form = context.form; /*var sentToIsabelButton = form.getField({id : 'custpage_senttoisabel'}); var resetIsabelStatusButton = form.getField({id : 'custpage_resetisabelstatus'});*/ log.debug('entering code'); form.clientScriptModulePath = './CMB_cs_pfa_functions.js'; form.addButton({ id: 'custpage_senttoisabel', label: 'Sent to Isabel', functionName : 'checkIsabelStatus()' }); log.debug('senttois'); form.addButton({ id : 'custpage_resetisabelstatus', label : 'Reset Isabel status', functionName : 'uncheckIsabelStatus()' }); log.debug('resetisabel'); } return{ beforeLoad : beforeLoad }; } );
c
When you specify the functioName in the UE script, try leaving the parenthesis out. functionName : 'checkIsabelStatus()' Should be: functionName : 'checkIsabelStatus'
Same for: functionName : 'uncheckIsabelStatus()' -- functionName : 'uncheckIsabelStatus'
v
I tried that too, it didnt work
j
Try sending the newRecord variable as a paramater in the function name. 'uncheckIsabelStatus(' + newRecord + ')'
c
Are you getting errors anywhere? Are all of the alerts triggering?
I don't believe the context object is available to your button functions. I have a feeling your client script is erroring out. Try importing the currentRecord module, and using currentRecord.get() to access it
v
@JessicaL no it didnt accept that, no progress
@Corey Schwoebel yes after importing currentRecord module, the UE script calls the CS script.
in this, clicking on the releant button, the line "Entering check function" is getting executed. but further nothing happens. could you please tell what is the problem?