My Stuff
Comments
-
Try this script, it worked in my dev account deployed as a global client script on purchase order records: function poOnSave() { if(nlapiGetLineItemCount('mediaitem') >= 3) { return true; } else { var numFilesNeeded = 3 - nlapiGetLineItemCount('mediaitem'); alert('Add ' + numFilesNeeded + ' more files before saving');…
-
mushrush Your request is simple, but unfortunately NetSuite doesn't run any triggers in that context, so the solution is more complicated. Here's my suggestion in code, deployed as a user event script on the customer record. khultquist has a good suggestion too if you're ok with waiting for a scheduled script to run.…
-
I've never tried having 13 columns in a suitelet, so I'm not sure if there's a limit. Have you tested removing different columns to confirm that each column works independently, as long as you stay under an 18 column limit total? With portlets, there are strictly enforced limits on the number of columns which I have worked…
-
I just tested in my development account and user event scripts are still running on xedit. In what context are you triggering your inline editing? If the inline editing is inside a user event script or plug-in implementation, then other user event scripts won't trigger.
-
In addition to Oliver's idea to use a Suitelet instead of NetSuite's own upload screen, another option could be a user event script on the record with the document custom field. The user event script could move the file to the desired location when the record is saved.
-
Is there any chance that you're writing a client script? In that case, you can use native web browser APIs. Otherwise, unfortunately the answer is no. If this fits your business process, you might consider calling nlapiRequestURL in a try/catch block and retrying x number of times on time-outs. The alternative would be…
-
Why wouldn't you do this server-side? This can be accomplished easily in a before load user event script: function beforeLoad() { for(var linenum = nlapiGetLineItemCount('item'); linenum > 0; --linenum) { nlapiRemoveLineItem('item', linenum); } } Also, even if you do use a client side script I would still recommend the…
-
Glad it was helpful! Here's the full list of before load execution context types from SuiteAnswer 10635 (there are different execution types for before and after submit, also listed in the SuiteAnswer): [LIST] [*]create [*]edit [*]view [*]copy [*]print [*]email [*]quickview [/LIST]
-
I agree with pcutler this should be done server side, avoiding unpublished API. The trick on server side is to trigger the script only after once, when the copy button is used, otherwise the script will clear all lines every time that you edit the record. I believe you can use nlapiGetRecordId() to determine if this is a…
-
As others have stated, NetSuite intentionally enforces this 1000-point limit on client scripts.So if you need more than 1000 points, the first option I would consider would be Restlets which are allocated 5000 points. Your button could call a Restlet which would create the work orders. Finally, if 5000 points is…
-
I've often handled my own pagination by using nlobSublist.addButton to add PREVIOUS PAGE and NEXT PAGE buttons. On click of those buttons, you can redirect to the URL with a parameter such as &page=2. Then when the suitelet runs again, it can use .getResults(x, y) to get the correct result set.
-
Hi Matt, it looks like your code confuses client and server script. For clarity, it may be easiest to create a separate client script that includes the client script methods including the button click function. Then, you can use form.setScript() to associate your client script with the Suitelet. Also, I don't believe that…
-
I have encountered both of these issues, but haven't spent too much time investigating them. For the first issue, I took the same approach and used JSON.parse on the stringified object. For the second issue: there is no way to retrieve the external URL of the RESTlet which forces a user to have to use the rest domains…
-
NetSuite doesn't have an API method to add a CSV export button, but it's not that hard to add yourself - First, add an export button to either the form or the sublist. For example: form.addButton('custpage_export_button', 'Export to CSV', 'exportCsv()'); Then, add a client script with a function that runs the suitelet with…
-
May I ask where you got the library files from? Sure! SuiteAnswer 42172 recommends downloading the files from the following links: https://github.com/ddo/oauth-1.0a https://code.google.com/archive/p/crypto-js/
-
If you throw an unhandled exception in the before submit script, NetSuite will display it.
-
In your OAuth constructor, are you passing a signature method? For example: var oauth = OAuth({ consumer: { public: myConsumerKey, secret: myConsumerSecret }, signature_method: 'HMAC-SHA1' });
-
Since this is third party code, check if the third party code is taking any other actions that trigger other UE scripts. If so, you may be able to piggy-back off of those. Also, if the 15 minute wait time is unreasonable, you can have an external process that calls a restlet at the frequency of your choosing.
-
For field IDs, check out the records browser: https://system.na1.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html
-
Thanks for the tip. I believe the reason we don't see those two calls in NetSuite's code is because they're inside the authorize method in the oauth library. NetSuite's code calls .authorize: var headerWithRealm = oauth.toHeader(oauth.authorize(request_data, token)); And the authorize method contains those two calls:…
-
If you're interested, you might be able to track down the logic Google Chrome uses to pick the default. It might also relate to the extensions you have installed. I don't think NetSuite is going to file a defect or make any changes to address this though.
-
The only two API calls in the snippet you provided that consume governance points are the two calls to nlapiSearchRecord. As Oliver said, the governance is being consumed somewhere else besides the snippet above. If you're not sure which script is causing the error (possibly restlet or user event triggered by a suitelet)…
-
Depends what your logic is for each line item. Instead of tracking your governance usage this way, try hand-counting the number of governance points that your API calls use. API Unit Usage per API Example nlapiDeleteFile nlapiInitiateWorkflow nlapiTriggerWorkflow nlapiScheduleScript nlapiSubmitConfiguration nlapiSubmitFile…
-
NetSuite support provided the answer - I was missing one library file. It now logs in successfully with the following three libraries (in this order): oauth-1.0a.js hmac-sha1.js enc-base64.js
-
Did you call nlapiSetRecoveryPoint() first?
-
Above the console textbox, there's a drop-down list with each of the frames on the page as well as your extensions. This specifies the context that your console code runs in. Make sure that the NetSuite page is selected. It will probably be "top" unless you iframed the NetSuite page inside something else.
-
Thanks for the input and agreed, just hoping for a good work-around to search all system notes at once.
-
I'm running into this as well, has anyone found a work-around? I know I can search other record types and join to their system notes, but that would be a large number of searches to search every record type.
-
Really cool, and just in time for my needs. jmkplessers - Thanks for looking this up!
-
Have you tried: var estimateId = 123; // internal id of estimate var shipAddr = nlapiLookupField('transaction', estimateId, ['customer.shipaddress1', 'customer.shipaddress2', 'customer.shipaddress3', 'customer.shipcity', 'customer.shipstate', 'customer.shipzip', 'customer.shipcountry']);