This topic contains 12 replies, has 0 voices, and was last updated by kphu 6 years, 9 months ago.
-
AuthorPosts
-
December 14, 2017 at 12:01 am #21374
kbaruaWe have a user event script that adds a button to the item fulfillment.
Clicking the button calls a suitelet that prints a packing slip pdf.
The button works fine in Chrome, but doesn't do anything in IE?
This is a cached copy. Click here to see the original post. -
December 15, 2017 at 12:06 pm #21375
pcutlerHave you been able to diagnose where the script is failing in IE?
Generally, the process is:
1. User event script adds button
2. Client script runs on button click and calls Suitelet URL
3. Suitelet runs when URL is called
I'd start by trying to diagnose where the failure occurs – does the button show up? If you start the client script with a console.log statement, does it log? If you start the Suitelet with a log statement, does it log?
If you find the problem is in the client script, which is likely because browser support for JavaScript API methods can vary, then you can debug your client script using IE's developer tools by pressing F12.
-
December 16, 2017 at 12:32 am #21376
kbaruaNo, I haven't run diagnostics. The button does show up in IE.
There's no client script that I can see. Just a user event script and suitelet.
I'm having some trouble adding a console.log statement. Could you provide sample code for it?
-
December 18, 2017 at 12:07 pm #21377
pcutlerSure! You would use console.log as follows:
Code:
console.log("whatever you want to log") -
December 18, 2017 at 1:09 pm #21378
kbaruaThanks, but this is the error I'm receiving:
Notice (SuiteScript)
ReferenceError: "console" is not defined.
-
December 18, 2017 at 1:12 pm #21379
pcutlerThe console.log method is only available in the web browser. It sounds like you may be editing a server script, in which case you want to use nlapiLogExecution("DEBUG", "TITLE", "DETAILS");
-
December 18, 2017 at 1:14 pm #21380
pcutlerUnless it's SuiteScript 2.0, in which case you want to use
Code:
log.debug( { title: "some title", details: "some details" } ) -
December 18, 2017 at 4:23 pm #21381
kbaruaOriginally posted by pcutler
View Post
The console.log method is only available in the web browser. It sounds like you may be editing a server script, in which case you want to use nlapiLogExecution("DEBUG", "TITLE", "DETAILS");
I inserted this code and didn't receive any errors. Do I navigate to "Script Execution Logs" to see the results? If so, I'm not seeing anything there after executing this script in multiple browsers.
-
January 6, 2018 at 11:05 am #21382
pcutlerOriginally posted by kbarua
View Post
I inserted this code and didn't receive any errors. Do I navigate to "Script Execution Logs" to see the results? If so, I'm not seeing anything there after executing this script in multiple browsers.
Yes, these logs should show up under the script execution logs tab of the script record. It's possible that your script's log level might be set to Audit, Error, or Emergency, in which case you would not see DEBUG-level logs. You can edit the script deployment record to change the log level.
-
January 24, 2018 at 12:36 pm #21383
kbaruaThe button shows up for all users in various browsers. But clicking it doesn't work for all users.
It does work for me and another user in the custom role they are using. Any idea how this can be?
-
January 24, 2018 at 12:57 pm #21384
MikeBucklaewWonder what version of IE you're using? One thing to check is that there should be a client script attached to the form. It has the function that the button calls. there's probably a form.setScript() call in the UE script. (or if 2.0 a form.clientScriptFileId = 'script file id'; ) in that script there's typically a window.open(URL, name, specs, replace) call. The first parameter will have the url of the printing suitelet. If the second parameter (name) has a space in it, I've read that IE will fail but other browsers will work OK.
-
January 24, 2018 at 6:01 pm #21385
kbaruaI found that it's independent of the browser and now just user specific. It works for me in Chrome and Firefox.
But for other users it doesn't work in either browser. I tried looking under preferences for a global pdf/print setting.
-
January 26, 2018 at 12:23 pm #21386
kphuYou can try setting the suitelet to run as admin.
-
AuthorPosts
You must be logged in to reply to this topic.