My Stuff

BrettKnights Red Ribbon

Comments

  • If you are sending another GET request to the suitelet to get a list of things dynamically you'll have to be building the url up somewhere. That means you'll have to build the url on the server (doubtful since if you could do that you could just include the relevant data anyway) or add it in via a client side script. I…
  • You often can't extend javascript built in objects in server side code. Also you've picked an area that's a little hairy -- the 'vendor' in your query won't return what you think it should and the nlapiSubmitField call won't work var recType = nlapiGetRecordType(); var recId = nlapiGetRecordId(); var x =…
  • console is from testing this in the firebug console. Remove it for server side code your mass modify script should have signature: function setPrefVendor(recType, recId) and you should remove the corresponding lines var recType = nlapiGetRecordType(); var recId = nlapiGetRecordId(); from the script. itemvendor is not…
  • Have you tried adding the support case number as a hidden field on your form? That should do it.
  • Hi there. It's difficult to even see if this is something to comment on since the script you provided doesn't do anything. e.g. your script: [LIST] [*]uses itemIds as the basis for a filter but itemIds is never initialized [*]loads soRec and later submits it but soRec is never updated by the script [*]doesn't indicate…
  • I see a couple of things I'd do with your code. First off I always make a small function to do my parsing. The problem is sometimes Netsuite returns a null or empty string where you expect numeric values so: function getVal(v){return parseFloat(v) || 0.0;} getVal applies parseFloat and returns 0.0 if the parse operation…
  • The Suitelet script seems to be the only viable solution. Is it possible to call the suitescript via javascript without the browser changing urls? Meaning when the customer presses the button that executes the javascript the browser does not appear to have navigated to another URL. Retsuca, Communicating with the server…
  • Hi Neil, Both of these work: var c = nlapiLoadRecord('supportcase', caseId); c.setFieldValue('emailform', 'T'); c.setFieldValue('outgoingmessage', 'This is my scripted message to the customer'); nlapiSubmitRecord(c); // or nlapiSubmitField('supportcase', caseId, ['emailform','outgoingmessage'],['T','This is my second…
  • Yes. KOTNUtil.each was written in the style of jQuery's each function. This was before netsuite supported a more modern Javascript interpreter. These days I'd use items.forEach(function(item, idx){...});
  • Transfer orders are available. Production code that simulates an inventory transfer: function transferInventory(items, fromLoc, toLoc, qtyField){ var xfr = nlapiCreateRecord('transferorder'); xfr.setFieldValue('location', fromLoc); xfr.setFieldValue('transferlocation', toLoc); var atLine = 1; KOTNUtil.each(items,…
  • The scheduler is not clever enough to reschedule your script. First thing to check is does a custom mass update script do the job? Are you updating only the transaction that is the result of the search? If not then you need a way to test whether or not you've processed everything. There are a couple of ways to do this. If…
  • A script is not automatically re-scheduled due to metering outage. See my post https://usergroup.netsuite.com/users/showthread.php?t=24707 for some code that might help.
  • Unfortunately option 2 didn't work either :( Anyone got any more ideas? Not quite what you mean by "didn't work". I've got code in production on over 25 Netsuite sites that uses the basic technique described to limit shipping methods. The code I sent back was based on your sample code and, as mentioned, wasn't installed in…
  • Matt, Joel's suggestion would certainly work and is the "right" way to do this. However if a non-coder is maintaining that list you need to keep the syntax to a minimum. The following (non-tested) code uses your proposed syntax. Note the use of 'anyAllowedChecked' to make sure you don't uncheck a legal shipping method.…
  • Try posting something to that url from a browser. I hadn't looked at it before but on review it looks like you just took an internal suitelet url and changed the host. Use a different browser or log out of Netsuite for the test. To use "forms.netsuite.com" you have to make the suitelet not require login and set the…
  • I am assuming the conversation with your Suitelet will be from your PHP code. If so then do you need anything more than a pre-agreed secret key that you include as a parameter? The communication with Netsuite is already via SSL so the content of the data is already encrypted. In your suitelet you want to ensure that the…
  • You might try setting a user agent header to mimic one of the common browsers HTH Brett Knights
  • Yes but the OP asked about documentation. What features are exposed? We've been hearing about scripting the checkout but what exactly do we get? Why bother asking for it to be enabled on a production account when it may actually cause problems we aren't ready to deal with? I can just see it now... "Hello Netsuite? Please…
  • The short answer is that you're hosed. The long answer is that this is doable but you'd need to create a Javascript implementation of a Kerberos client. It's often the case that someone will have created one of these (a complicated protocol implementation) as a student project and open sourced it. Hopefully LGPL or MIT…
  • And just for the record it was me. It looks like this issue was caused by Adobe Download Manager. Apparently it installs an Akamai service that, as near as I can tell, acts as a surreptitious proxy I disabled the Akamai NetSession service and haven't been able to recreate the issue since. Hope this helps someone.
  • 2) This is indeed invoked as a before load user event. 3) The new function approach is a way to namespace the function. I haven't read anything from NS that guarantees each script is in its own namespace. It appears that it is for server side scripts. In the past I've had interactions with client side scripts that this…
  • Hi Evan, I have done so. Case # is 1216194. I posted initially to the group wondering if it was just me -- either a virus or some interaction with NoScript on Firefox -- or whether it was more generally an issue.
  • for the function name you'd enter poManager.pageInit The function could just as well be poManager.bob -- there's no need for the name of the function to reflect its use (note I didn't say there's no reason for a function's name to reflect its use). In this case I'd probably rename it so it matched so what you'd enter would…
  • FWIW I found Steve Klett's comment on this helpful. According to the documentation you shouldn't be able to do what he suggests since the docs want any parameters to be prefixed with "custpage". However I thought I'd give it a shot since I needed the functionality and behold, a script that does a server side redirect to a…
  • Hi Jim, were you not successful in getting the script I provided to work? Ultimately all it does is call nlapiSetRedirectURL during the before load user event with the correct form id as a parameter. This is similar to what you do when you select a form during an edit -- if you do that you lose any changes you've made…
  • You might try: var CountTotal = 0; ... if ( eCertificate == 'T' && itemTypeName == 'Serialized Inventory Item') CountTotal++; HTH
  • Stefan, The following is some scratch code that was based on a NS sample. In a Wolfe Account with some prices defined it works to query prices in all currencies. var filters = [ // new nlobjSearchFilter('currency', 'pricing', 'is', '1'), new nlobjSearchFilter('isonline', null, 'is', 'T'), new…
  • I'm seeing this issue as well.
  • What it turns out (in my account anyway) is that the beforeSubmit script is running but changes made to the Sales Order are not retained. (e.g. nlapiLogExecution records activity).
  • This is still not fixed. What I've done so far was to extract the user event code into a function and then call that function from a mass update script. In my case it's easy to figure out which records need the script to be run so we're just having the order entry people run the script once an hour or so. Other strategies…