My Stuff
Comments
-
How are your general Javascript skills? I wouldn't recommend starting NS scripting until you are at least comfortable with basic JS. Personally I started by just reading through the help center documentation and then experimenting in our sandbox. NS does offer SuiteScript courses, and I believe erictgrubaugh offers his own…
-
User Event Scripts for records obtained from context.newRecord with the caveat that once the field has been set using setValue it cannot be retrieved using getText (which would require the text value to be derived from the id value and is not permitted for performance reasons) The error message seems to say the opposite…
-
I don't know if this is what's causing the issue, but you seem to be missing the <doctype> tag: <!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
-
You should be able to hide the field using just a User Event script. See this thread for a code sample: https://usergroup.netsuite.com/users...t-field-column It is also possible to run a client script in View mode. The way to do it is to have a User Event script set the client script using context.form.clientScriptFileId…
-
I'm trying to create a SS2 script that executes a saved search and then parses the results into a CSV file to FTP to another system. My search has several FormulaText and FormulaCurrency fields in it. When I try to parse the Search.results object all the formulatext fields have the same names so I can't access each unique…
-
If you don't need to higher usage limits of a Scheduled Script, another option could be to use a Workflow Action Script and triggered with nlapiInitiateWorkflowAsync()
-
"entityId" is the internalid of the transaction record you want to render.
-
Absolutely, it took me a while to figure this out. It's unintuitive and seems pointless. I also prefer the way SS1.0 returns the value directly instead of an object if you are only looking up a single field. SS1.0 var salerep = nlapiLookupField('customer', id, 'salesrep'); SS2.0 var results = search.lookupFields({type:…
-
This a really useful tool, thank you for sharing. Can a suggest a small fix though? It's a little confusing when you start creating a new search that has never been saved and you get an error - "Export as Script Not Supported. This search type is not supported by SuiteScript." This threw me off at first because the search…
-
Nope, you cannot change the Field Display Type in a client script, only in a user event script.. You definitely can do this, here is an example of making the 'comments' field enabled only if 'companyname' is not empty /** * @NApiVersion 2.x * @NScriptType ClientScript */ define([], function() { return { fieldChanged:…
-
This snippet should help, it's part of a Suitelet I wrote as an easy lead entry wizard. var entity = record.create({ type: type, isDynamic: true }); entity.setValue({ fieldId: 'companyname', value: cleanInput(params.companyname) }); entity.setValue({ fieldId: 'phone', value: formatPhoneNumber(params.phone) });…
-
For "Select / Multiselect" type fields, search.lookupFields() returns an array, so you need to access with: fieldLookUp.entity[0].value https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4345776651.html
-
You can actually put Saved Search Filters into the URL, which is probably a better idea than editing the Saved Search each time (what happens if two users are using the form at the same time...) Sample code (untested): if(duplicateCheckbox) { var dupeIds = record.getValue({ fieldId: 'custevent75' }).replace(',', '%05');…
-
As egrubaugh says, the equivalent function to nlobjField.setDisplayType() is Field.updateDisplayType(). However I think the issue is getting the Field object. In SS 1.0 you could do this with sublist.getField() (though I believe it's undocumented), however this doesn't work in SS 2.0.
-
I ran a search on Script Deployment where Record=Credit Memo and found 2 user events and one client script. Marked them un-deployed to no avail FYI, NetSuite actually has a "Scripted Records" page that will show you this information and more (Customization > Scripting > Scripted Records). You also need to rule out a…
-
That would be search.lookupFields(options) https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4345776651.html
-
Something like this should work: formulanumeric1 = result.getValue(closingMonthSearch.columns[14]); formulanumeric2 = result.getValue(closingMonthSearch.columns[15]); formulanumeric3 = result.getValue(closingMonthSearch.columns[16]);
-
You are using the SuiteScript 1.0 API but declaring it to be a 2.0 Script in the JSDoc. Remove the comments at the top of the code for NetSuite to recognize it as a 1.0 script.
-
I tried what you said in edit mode and it works, but boy is it clunky as it seems you have to wrap all your real test code inside a callback like so: require(['N/record'], function(rec){ var x = rec.load({ type:'invoice', id:45 }); console.log(x.getValue('entity'));}) Typing this sort of code isn't fun in the dev tools…
-
I got this by looking at the Javascript code loaded by Netsuite. The easiest way to do this in Chrome is to open the developer console on any Netsuite page and write the name of the function (without any brackets), and press enter. The console will return the function, and by clicking on it will take you to the position in…
-
You could copy the code from the SuiteScript 1.0 API source file: function isLeapYear(year) { return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); } MONTH_LENGTH = [[31,28,31,30,31,30,31,31,30,31,30,31],[31,29,31,30,31,30,31,31,30,31,30,31]]; function getMonthLength(year, month) { return…
-
Here's my feed list.. (had to split over two posts for forum to accept) <?xml version="1.0" encoding="UTF-8" ?> <opml version="1.0"> <head> <title>Feeder - RSS Feed Reader</title> </head> <body> <outline title="Netsuite" text="Netsuite"> <outline text="Stack Overflow -…
-
Part two: <outline text="Keystone Data Blog" title="Keystone Data Blog" type="rss" xmlUrl="http://www.keystonedata.co.uk/feed/" htmlUrl="http://www.keystonedata.co.uk/feed/" rssfr-favicon="http://s2.googleusercontent.com/s2/favicons?domain=keystonedata.co.uk" /> <outline text="Prasun's Blog" title="Prasun's Blog"…
-
You can see this by navigating to Setup > Company > View Billing Information. I have a handy Saved Search I use to check exactly which users are using Full Access Licenses Search Type: Employee Criteria: Inactive is false Login Access is true Role Fields.. Inactive is false Role is none of: none, Customer Centre (add…
-
Is anyone else experiencing this? Yes https://usergroup.netsuite.com/users/forum/platform-areas/customization/suitecloud-development-framework-sdf/416575-error-deploying-an-xml-resource-file-advanced-pdf-html-template I've had a defect created (# [COLOR=#000000]418309: SDF - Error deploying an xml"resource" file (Advanced…
-
I was researching and I see that it's somewhat possible via Visual Studio Code, but I was curious if there is a way to write NetSuite code (including intellisense) in Visual Studio Enterprise? You can probably get Intellisense at least for SS1.0 working by grabbing a copy of the jsdoc file that SuiteCloud IDE uses and…
-
Could y'all clarify what you mean by SDF and CLI? SDF is SuiteCloud Development Framework Overview. It's basically a way to represent the various customization objects in your account as XML files, which makes it possible to package them together with your script files and keep them under source control etc. It's available…
-
For SDF Javascript files, I usually place the the script files in File Cabinet/SuiteScripts/<Project Name>/UserEventScript.js You only want files referenced as dependencies in your manifest if they are are not in the project. In your case, I would remove them from the manifest, and ensure that the object definitions…
-
A workaround that I use is to have your actual template consist of just an "<#include>" tag, which imports the actual template from a file stored on the File Cabinet.
-
That is brilliant, Michoel! It's going to speed up my development cycle by half! :) I'm hoping to find the time to write a post somewhere, but my full set up is even better. I use Visual Studio Code as the editor, with a gulpfile that watches for file changes, and automatically preprocesses my script, uploads it and…