I am trying to print messages in a client script, ...
# general
r
I am trying to print messages in a client script, it used to work before but has suddently stopped recently. When I press F12 on the browser to view the console, I notice that there is a line that says 'Suppress=T', maybe all the messages are being suppressed somehow. This used to work earlier but somehow none of the message printing mechanism ( console.log, log.debug, dialog.alert) seem to be working. This used to work before and even if I create a copy of the form on sandbox, the issue does not go away. Has anyone else faced this? Attaching the sample code for your reference. Thanks in advance
define(['N/record','N/search','N/ui/dialog', 'N/log'], function (record, search, dialog, log) {
/** *@NApiVersion 2.0 *@NScriptType ClientScript */ function pageInit(context) { console.log('Console LOG - PageInit0001'); log.debug({ title: 'Customer First Name', details: 'TEST LOG' }); dialog.alert({ title: 'Announcement', message: 'TEST Alert' }); } return { pageInit: pageInit } });
b
code looks fine
either the script isnt deployed correctly anymore
or something before it is throwing an error
r
I have used these messages extensively in the past, what is troubling me is not knowing what caused them to stop working
I am suspecting this
b
usually errors are more red
but safe bet is to disable other client scripts and workflows deployed to the record
r
done that, no luck 😞
b
dont forget the ones deployed to all records
it looks like you at least have drag and drop
n
Are you testing this in view mode or create/edit mode?
r
@battk Tried disabling them as well but no luck. @NickSuite I am clicking on 'Receive' button on the PO, which opens the item receipt on the edit mode
n
remove everything from the pageInit and simply add an alert("Page Init");
r
not showing the alert as well, removed everything else but nothing happening. Tried the same thing on MS Edge as well as chrome
b
it probably wont matter what code you do at all
its not being run
👍 1
usual causes for that are errors in other scripts, or the script or deployment not being setup correctly
r
strangely, I have been trying some of the scripts that used to show messages before but they are also not working now
b
usually you can tell when an error is being thrown in the console, though what you shared is insufficient to tell, so my guess is that you dont know what errors in console should look like
and if your script isnt being run now, its probably too much work to show what they are supposed to look like
which is why i just said to disable other scripts, which usually means a visit to Scripted Records
r
I am just getting this in the console
b
looks like no errors
which means you should be looking at the script deployment and script record
of your script
there are lots of things to check there, basically everything that can be edited on the deployment can cause your issue
the script record itself only has a inactive checkbox, and the script file
r
since this is a client script, I am checking on the file permission side now
b
and the script file would only have a problem if the filename is wrong
r
so it is only happening in SB, just tried similar on a custom form in prod and it is showing the messages
so I raised a support ticket on this and netsuite support managed to fix this. All this while, I kept thinking that I managed to break the system 🙂 Thanks for your support, especially to @battk