This topic contains 12 replies, has 0 voices, and was last updated by yang 16 years, 10 months ago.

  • Author
    Posts
  • #4409

    sklett

    A colleague granted me access to a test account so that I could actually try installing my Bundle (NetSuite, if a customer makes bundles public you should consider giving FREE sandbox accounts)

    I was bummed to see that the installation failed to install my SuiteLets and User Event scripts. I just double-triple checked and tried again, doesn’t work.

    Any known issues?
    This is a cached copy. Click here to see the original post.

  • #4410

    William Bailey

    RE: User Event and SuiteLet scripts not installing

    What’s the bundle ID of the bundle with this problem? Are you sure the Server Suitescript feature is turned on in the target account?

  • #4411

    sklett

    RE: User Event and SuiteLet scripts not installing

    Hi,

    The bundle ID is 1034

    The server side suitescript was turned off, good catch, I didn’t even realize that was an option!

    So now my scripts are installing. However, I do get the following error when the SuiteLet is displayed:

    That Suitelet is invalid, disabled, or no longer exists.

    I’m logged in as administrator and I’ve checked the roles on the deployment and all seems fine.

    Any other ideas what could cause that error?

  • #4412

    William Bailey

    RE: User Event and SuiteLet scripts not installing

    does everything about the suitelet look identical in the source vs target accounts? Same javascript file, same deployments?

  • #4413

    sklett

    RE: User Event and SuiteLet scripts not installing

    From what I can tell, yes.

    I took a bunch of screen shots so you could compare.

    http://www.pmddirect.com/temp/document3.pdf

    I’d really like to get this work, your help is appreciated.

    Thanks,

    Steve

  • #4414

    William Bailey

    RE: User Event and SuiteLet scripts not installing

    Nothing looks awry on the surface. So you are saying when you try to run the suitelet by navigating to /app/site/hosting/scriptlet.nl?script=17&deploy=1 you get the error?

    I assume you can download the javascript file in from the target account and it looks correct?

    I notice the audience is different (expected) but I assume you are doing this as admin in both accounts?

  • #4415

    William Bailey

    RE: User Event and SuiteLet scripts not installing

    Is it possible you are using the same URL in the target account to get to the suitelet? Note the scriptid changed when it was installed in target account (from 21 to 17). You have to use URL as shown on the records in the target account (and shown by me in last post).

  • #4416

    yang

    BTW – you can always specify a script ID for Suitelets which you can subsequently use in nlapiResolveURL() for URL resolution. This makes it a lot easier to write and bundle code that calls Suitelets without having to hard-code references to non-portable URLs.

    Thanks,

    Yang

  • #4417

    sklett

    RE: User Event and SuiteLet scripts not installing

    Originally posted by William Bailey

    Is it possible you are using the same URL in the target account to get to the suitelet? Note the scriptid changed when it was installed in target account (from 21 to 17). You have to use URL as shown on the records in the target account (and shown by me in last post).

    You got it!

    It was the script id (21 to 17), good catch.

    Thanks for all your help, I really do appreciate it.

    -Steve

  • #4418

    sklett

    RE: User Event and SuiteLet scripts not installing

    Originally posted by yang

    BTW – you can always specify a script ID for Suitelets which you can subsequently use in nlapiResolveURL() for URL resolution. This makes it a lot easier to write and bundle code that calls Suitelets without having to hard-code references to non-portable URLs.

    Thanks,

    Yang

    Hi Yang,

    Is there a magic-string that needs to be added before or after the script id? I just tried changing my code from:

    PHP Code:

    var suiteLetId   = ’21’;
    var deploymentId = ‘1’;
    var suiteLetUrl  = nlapiResolveURL(‘SUITELET’, suiteLetId, deploymentId); 

    To:

    PHP Code:

    var suiteLetId   = ‘customscript_task_comp_notes’;
    var deploymentId = ‘1’;
    var suiteLetUrl  = nlapiResolveURL(‘SUITELET’, suiteLetId, deploymentId); 

    It doesn’t work.

    Is this what you mean for the script ID?

  • #4419

    yang

    No magic strings. The 2nd arg should be the script’s script ID (or internal ID) and the 3rd should be the deployment’s script ID (or internal ID).

    Thanks,

    Yang

  • #4420

    sklett

    RE: User Event and SuiteLet scripts not installing

    Thanks Yang, I’ve got everything cleaned up and working now.

    This first bundle was quite a learning experience, some of the assumptions I wrongly made:asset ids would carry across accounts – unique IDs being what they are, it makes complete sense this is not the case. Switching to the named id is the better solution.
    ServerSuiteScript enabled by default – I didn’t realize that ServerSuiteScript was an option.
    There is a new version in the repository. I’ve changed the following items:Different design for submitting the SuiteLet – I was calling a function specified in the ‘script’ parameter of nlobjAddButton(). When the Callback was invoked on the parent form this resulted in a “Are you sure you want to navigate away from this page” message. Now I’m using addSubmitButton() and an OnSave() event on the client form script to invoke the callback. The callback still closes the popup and window and this was triggering the “Navigate away…” error so I now call window.close() from setTimeout() with 250 ms to let NS get past the submit code.
    Updating numeric ids with named IDs
    Removed required field enforcement and alert code, letting NetSuite handle it now that I’m using addSubmitButton()
    added a label to the text area field so that the required field alert would have a meaningful message rather that ‘null’
    Still To Do:

    Handle xedit!

    If anyone has a pattern in mind that would allow me to redirect to a SuiteLet from a Task BeforeSubmit, gather the data from the SuiteLet and then still properly let the Task complete through I’M all ears.

    I’d really like to know if this bundle installs correctly for anyone. I tried on the one test account that I have access to, but I can’t be sure it will work in others.

    -Steve

  • #4421

    yang

    If anyone has a pattern in mind that would allow me to redirect to a SuiteLet from a Task BeforeSubmit, gather the data from the SuiteLet and then still properly let the Task complete through I’M all ears.

    I’d really like to know if this bundle installs correctly for anyone. I tried on the one test account that I have access to, but I can’t be sure it will work in others.

    Can’t the logic that is run by the Suitelet (presumably on a task record) be executed when during a task beforeSubmit User Event?

    Thanks,

    Yang

You must be logged in to reply to this topic.