My Stuff
Comments
-
The search APIs have methods for retrieving more than 1000 results, check the documentation for nlapiCreateSearch() The problem, however, is that when loading values using addSelectOption(), the field will always be a simple dropdown, instead of that pop-up list Netsuite presents when using native sourcing. This fact can…
-
They are. If you think about it, there is little need for them NOT to be client-side. In before and after submit, you don't ever need to mess with the option of a dropdown. And in beforeLoad, well, you just set the values at that point, not really necessary to go back and forth between adding and removing stuff. You only…
-
This is in client-side?
-
Ah ha. No, you can indeed use this in client-side. For initial population of the field, you can use field.addSelectOption()
-
I've seen some cases where if the filter is invalid, NS simply ignores it and doesn't say anything. Is the 'product' filter perhaps expecting an internal id rather than a textual name?
-
What are you params in nlapiRemoveSelectOption(...) ?
-
That's right, your type is wrong. Because filtering by type is such a pain because the names are counter-intuitive, you can also just remove the filter on type and run your search as nlapiSearchRecord('invoice', null, ytdfilters, ytdcolumns); You might be, however, missing a filter on mainline, to be true or false -…
-
Sure, use them all the time. Want to post a failing code snippet?
-
Check out the documentation for form.addButton(). I think that's what you're looking for
-
We will usually place our own special encoding, like %%%shipmethod%%%. Then, after the merge, you take the file object and using javascript identify all your special %%% tags, read what field is expected, and replace it with the acquired value.
-
Are you running this in server-side? There is no window object in server-side, since the code is running in the context of the server, not the browser.
-
There is no predefined printing solution for Suitelets (aside from the browser's pring functionality, which most likely isn't going to cut it). You'll have to build your desired printout using nlapiXmlToPdf().
-
The last parameter for your addButton() is a onclick script to execute. e.g. funtion beforeLoad(...){ ... form.addButton('custpage_mybutton','My Button','mybutton()') ... } function mybutton(){ alert('hello world'); } Note that the onclick script must be deployed as a client-side script. You'll need to use form.setScript()…
-
Thanks for the quick reply Evan, and yay NetSuite for supporting ECMAScript 5 on the server! I'm coming from a long C++/C# background and every feature you list above is essentially native in C#/.NET. Therefore, they are all features I'll likely consider. I wanted to avoid trying to use a (ECMA5) feature (e.g. accessor…
-
Under default settings Sandboxes send emails to the user that triggered the script. Scheduled Scripts don't have users (they are considered triggered by the system), hence no emails. Probably easiest thing to do would be to go under Setup->Company->Printing, Fax & Email Preferences->Email and change the setting to send…
-
Place your script as a Before Submit and use nlapiGetOldRecord() to compare current field values vs old field values. If you don't want to do it in User Event for some reason (though you really should), just snapshot your field values during pageInit and compare them with the values during onSave.
-
Indirectly, sort of. You can't intercept the moment between pushing the button and the Invoice coming up, but you can run your code in beforeLoad of the Invoice. From there, you could do your verification, and if it's no good you can pop and error, which will interrupt the Invoice from coming up. It's not the best UI…
-
Right, that's not possible. Hence my curiosity. If you're not familiar with it, you should check out the debugging in Netsuite documentation in the Help. You'll never be able to run "suitescript" (which I intend to mean including nlapi functions) locally, but there are tools in NS and best practices to help you test it…
-
Yeah, I guess. Honestly I've only ever used it once or twice, it seems to me very risky to add HTML on Netsuite pages. I have one client I'm thinking of where, before we got engaged, the NS admin injected TONS of stuff. It looks spiffy but causes all kinds of havoc with scripts or even different browsers. I mean, sure,…
-
Are we talking about a Web Store page, or an internal Netsuite screen? If you're talking about actual NS screens, then you can add a custom "Inline HTML" field and do ti that way. What are you trying to inject, though? It is generally not wise to inject extra HTML into NS pages. Perhaps what you want to achieve can be done…
-
Indeed, RESTlets are NOT Web Services, so a WS Only role wouldn't work.
-
No, pricing schedules fundamentally do not work for "buy x get 1 free" pricing (since you'd need infinity columns to handle all the possible multiplicity). Best way to achieve this is scriptable checkout.
-
Ahh... this won't work. At all. The syntax is all wrong, but more importantly, the logic is flawed. There is no way to untag a record once a user finishes his editing. It is tagged in beforeLoad, which is good, but then it is never untagged. And anyway, how would you untag it? The obvious case is placing it in…
-
You know what, I just clicked that you can do mix and match quantiy discounting out of the box. Look at Pricing Schedules. You can create a pricing schedule and apply it to all items that are part of the mix-n-match group. You can tell the pricing schedule to sum the quantity of all items using the same pricing schedule…
-
In the Help, look at the Task Link table - SuiteFlex (Customization, Scripting, and Web Services) : SuiteScript : SuiteScript Reference : Supported Tasklinks and find the one for New whatever record. Alternatively, in Netsuite, create a New record and grab the URL Netsuite gives you.
-
There's no real standard way. You could try to hook into it using DOM code, but it won't be easy since there's no client-side trigger, you'd have to inject code into the HTML of the page. In the case of the close button, the simplest thing to do would be to remove the standard button and replace it with a custom button…
-
Hmm, just got back to reading this. Isn't the whole point of this that NS already warns you when you attempt to save a record that isn't "fresh"? This script just duplicates the native NS behaviour, though it turns the table on the users (i.e. instead of being the 2nd user to try to save that gets the error, it will be the…
-
Typically the best practice for discounting is to add a Discount item rather than reduce the price of the item. So, scripting wise, you may wish to consider adding a flat rate Discount item as the 6th line. Alternatively, if it is a consistant percentage, you can add a Subtotal item as the 6th line, then add a pre-defined…
-
Yay! I'm happy too :)
-
Hi Bonnie, The 3rd parameter of nlapiScheduleScript is an array of parameters nlapiScheduleScript(scriptId, deployId, params) You pass it an array it dot format, i.e. var myParams = []; myParams.custscript_bobo = 12; nlapiScheduleScript(whatever, whatever, myParams) Obviously, you must have created the script params…