My Stuff
Comments
-
Hello, You might want to try something like the following. It should work since your error handling will be in the callback function and it won't be in scope when nlapiYieldScript is called. I put simpleBatch in a script file and just include it as a library for those batch scripts where the array to process can be…
-
Yes. you are right. Search Results does give you record type and id by default. However, Have you every had an instance where you are looking at a linked record on a transaction... say Cash Sale and createdfrom of XYZ. You want want to find value on certain field on that createdfrom record. You can't do nlapiLookupField()…
-
Hello, You don't state which user event you are updating the record in. If you are doing this after submit or any other server side script you can do it something like the code below. The code below was used to copy the addresses from a set of customer records to one customer (rolling the addresses up to a 'buyer' record).…
-
once you have the w3c document object you can use nlapiXMLToString. To populate the document it's not at all difficult (tedious perhaps) to roll your own object to XML builder. Though I have to ask why not JSON? the JSON object is global in NS scripts
-
I use the following on case events. You could use something similar for any of the other crm types. var kotnCaseEvent = new (function(){ function migrateCustInfo(custId, type){ var custFields = []; var custValues = []; var casePhone = nlapiGetFieldValue('phone'); var mobilePhone =…
-
Even in the non-Netsuite world what you are trying to do might be commonly pre-calculated and published on a daily basis. (though with access to real SQL and the power of a modern DBMS the necessity might have more to do with getting the data first into a non-transactional database to avoid locking your transactional…
-
Hi All, I am relatively new to scripting and whilst I have managed to get some scirpts working I am getting a strange error which I can't figure out. I set my script as a workflow (WF) action and have tested it as a button on a custom record and it works fine, I am now trying to incorporate it into another WF which…
-
AFAIK useful tutorials are few and far between. SCO has a number of links on this site as well as the NS samples are useful if what you are doing is what the samples show. SSP docs in NS help seem to be ok but in the usual NS fashion. One thing you might want to look at are examples of servlets (a Java based server-side…
-
Hey Wiz, SSP would now allow you to completely script the cart and filter shipping the shipping methods shown. The old school way is to do this client side. Things are easier with the advent of Scriptable Check Out. You can use SCO to set a field that contains a list of valid shipping method ids. A client side script can…
-
Steve, nlapiLogExecution works fine if you set your SCO script up as a deployed script rather than a form level script. Then set your audience to the appropriate customer center role(s) and "shopper" if you only want the script to run for the web store. You can return info to the browser by using custom transaction body…
-
We have a save search which shows 5000 invoice records. We want to manipulate it in one shot. But when searched, netsuite returns 1000 records always. I am trying to add a filter to get records greater than certain no(internal id) in this case. Here is the code var filters = new Array(); filters[0] = new…
-
If you've uploaded it to your suitescripts directory and can't include it as a library file for the portlet then you can include it as a normal <script> reference in an inline html field in your portlet.
-
Rafe, One way to return a csv file to the client without creating a record in the file cabinet is with a call to a suitelet. The following is an example of suitelet function that generates a CSV file and returns it to the client. The client would get a pop-up asking what to do with the file. function returnCSVFile(request,…
-
What is it you want to make simpler? There are a number of configurable ways to get data out of Netsuite. Without scripting you can already create a saved search and save the results as a .csv or run that saved search daily and send the results as an attachment.
-
I'd like an api that will return quantity available for an inventory item or kit/package. It must be able to be called from another internet store. Is there anyone who can help me with this? You might find this thread useful: https://usergroup.netsuite.com/users/showthread.php?t=29024 If you have an external site you might…
-
1. Brett's example code is GREAT. However, it's crazy that something so unintuitive/complex is needed to recreate functionality that ALREADY exists in NetSuite (any other CMS or programming environment etc. would ALWAYS expose functions like that so you don't have to reinvent a potentially inferior wheel). Just to clarify…
-
Thanks for the quick response Brett. But it doesn't seem to work, maybe its not supported anymore? -Smitha I think they still are. The parameters are supposed to work with scheduled scripts and appear to work for suitelets. I think you'll get an error if you use them where they are not supported. BTW if you are calling…
-
try loading the record and getting the result directly. e.g. rec = nlapiLoadRecord('opportunity', internalid); var myPosn = rec.getFieldValue('custbody_my_position_vs_competition');
-
There is a gotcha here if you are validating the returned body by logging the result. NS doesn't escape the xml for you so if you log the result you will just see the text value of the nodes unless you view source on the log record: e.g. var r = nlapiRequestURL.... var body = r.getBody(); nlapiLogExecution("DEBUG",…
-
Normally you shouldn't have to worry about the browser version if you stick with the supported client script events. If you are creating a custom UI first of all try to do it with standard Netsuite. You can open a suitelet window as a dialog and have the code there call functions in the parent window. If you are loading a…
-
I think you're subject on this is a bit misleading since a lot of browsers before the current crop didn't support Ecma5 functions. IE5 was a long time ago in that respect. There are various ecma5 shims as well as json2.js that you can upload to your suitescripts folder and include as libraries for your client side scripts.…
-
see this thread
-
If you are wanting this information for on-going maintenance you can create shadow field that is searchable and copy the template name into it when a record is saved. Something like: function itemBeforeSubmit(type){ if(type == 'edit' || type == 'create'){ var tmplt = nlapiGetFieldText('storeitemtemplate'); var shadow =…
-
I have a user event script with beforeLoad function implemented. If the user is on form internal ID '57', I want to do nothing. Any other form and the customer is of a specific category, I want to redirect to a another form. My problem is that the script is going in to an endless loop. I need to interrogate the ID of the…
-
You can do this with a script though the scripting is a little involved. Basically you'd need to: Load the assembly and walk through the member list to get the ids of the member items. Search the member items for their type and available quantity. For each of the searched items you'd need to decide whether the type's…
-
one way would be to add a datestamp to the swf url e.g. '&ds=' new Date().getTime() This can be done a number of ways depending on how you are defining the tags for the swf.
-
Can anyone please help me with this? In order to do a normal post you need to pass the body as an associative array (basically as an object) var POSTData = {tokens:sometokens, order_body:myXML}; var response = nlapiRequestURL(soapURL, POSTData);
-
curious. I'm running the code client side and it never fails to find the item: var order = nlapiLoadRecord('salesorder', 224784); for(var i=1; i <= order.getLineItemCount('item'); i++) { console.log('Index: ' + i + ', line: ' + order.getLineItemValue('item', 'line', i) +' found at '+ order.findLineItemValue('item',…
-
One use I can see for x.findLineItemValue('item', 'line', value) is if you had gotten line #s from a saved search or had already stepped through the lines on a loaded transaction (although in that case why not just use the index?) the line # doesn't appear to have much to do with the line index. e.g. contrived example var…
-
Not sure about the print button doesn't work for you but I've used that technique a number of times without issue. You don't actually want to call nlapiSetRedirectURL with an array. NS documentation doesn't often misses the distinction between an object used as an associative array and an actual array object. the following…