This topic contains 12 replies, has 0 voices, and was last updated by kphu 6 years, 9 months ago.

  • Author
    Posts
  • #21374

    kbarua

    We 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.

  • #21375

    pcutler

    Have 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.

  • #21376

    kbarua

    No, 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?

  • #21377

    pcutler

    Sure! You would use console.log as follows:

    Code:
    console.log("whatever you want to log")

  • #21378

    kbarua

    Thanks, but this is the error I'm receiving:

    Notice (SuiteScript)

    ReferenceError: "console" is not defined.

  • #21379

    pcutler

    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");

  • #21380

    pcutler

    Unless it's SuiteScript 2.0, in which case you want to use

    Code:
    log.debug( { title: "some title", details: "some details" } )

  • #21381

    kbarua

    Originally 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.

  • #21382

    pcutler

    Originally 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.

  • #21383

    kbarua

    The 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?

  • #21384

    MikeBucklaew

    Wonder 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.

  • #21385

    kbarua

    I 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.

  • #21386

    kphu

    You can try setting the suitelet to run as admin.

You must be logged in to reply to this topic.