My Stuff
Comments
-
If you are trying to delete all records of a certain type, I would recommend writing a Mass Update script instead. function deleteAllRecords(rec_type, rec_id){ nlapiDeleteRecord(rec_type, rec_id); } That's the entire script is just that one-line function. The rest of the behavior is determined by how you deploy the Mass…
-
You're welcome. Let me know if that solves your problem.
-
Sounds possible although I'm unfamiliar with those record types (I've worked almost exclusively with custom types so far) - via a User Event Script on the "create" event for the record that should trigger the action you want. Sorry that's a really vague answer - but do you think a User Event script would suit your needs?…
-
I tend to need this only where I'm setting a field as part of handling the event that the very same field just changed. You know right off the bat that's going to be a loopy scenario.
-
You can nlapiSetFieldValue('custrecord_myrecordtypefield', nlapiGetRecordType()); inside the beforeSubmit function of a User Event script to accompmlish what brian.hayes said.
-
Okay. What solution have you used to overcome the problem?
-
Would you mind explaining this in greater detail? It looks like a solution has been provided but it sounds also like the answer to one of my problems of mapping IDs where I have to do a lot of hard-coding because my project dynamically assigns different record types and fields to things.
-
It sounds like khultquist is suggesting you create an event listener on the DOM, in JavaScript, rather than relying on Client script events, so that clicking the button performs that desired action. The Client script can modify the button and/or create a new <script> node in the document after loading, to handle this. Am I…
-
I have an idea but it's a bit long-legged AND hard-coded. It involves creating a hyperlink to the desired script after the page loads. You can do this with the Default text of an Inline HTML field OR with a User Event script OR with a Client Script. The following is the default Inline URL text approach - but partly…
-
Is the User Event Script deployed to that record type? That's usually the part I forget.
-
Can't say I've had problems, but it does appear that NetSuite logs out the current user if they log in from another User Agent (device/IP-address/browser combination). This sounds like another subject so you should probably create a new Post/Thread.
-
If you really have to put passwords through the request like in a hyperlink, it is best to encrypt them with a salted hash, and maybe salt the salted hash with a different salt too. That makes it saf-er...
-
In the meantime, hackish workaround: Deploy a client script which generates a <script> tag on the document after it loads. Attach an onchange event handler in that javascript, which makes the necessary NL API calls. OR wrap the existing submit/save button click handler with that. Hope that roles/permissions doesn't…
-
One optimization I sometimes use is to instead of doing several small searches, then instead I load everything I could possibly need in one search, and then filter and aggregate it using scripted logic. I'm not sure if that helps your situation but it's usable. That will speed things up, but to overcome limits, best bet is…
-
Maybe you have to call the function in a server-side script instead of a client-side script? I vaguely remember something about the date functions like that. I think it can only access your user preferences in a server-side script. Client scripts have no option but to use the user's machine settings, I think....
-
I recommend this approach instead of jQuery/DOM because using the NS API calls, your script won't break when NetSuite changes its UI later this year, and you won't have problems with the way different browsers interpret the DOM
-
on the other hand, my approach will not show any unsaved changes. The DOM/jQuery approach will show exactly what's on the form BEFORE it is saved. So you might want to do that if you're looking for unsaved input. API calls might only show what's on the saved record -- I haven't tested to see.
-
I had the same idea as #1. This should work since the popup comes from the same domain (netsuite). Also if you don't want to worry about browser/DOM issues, you could use the NetSuite api from the parent window to grab the values! I tried the following when I was looking at a Contact record popup opened from a Client…
-
to break a loop in javascript: break;
-
There is a standard JavaScript function that fixes all those tricksy characters for you, if I'm not mistaken. Would it work to pass it through encodeURIComponent(), for instance?
-
Many of us here in the U.S. think Daylight Savings Time is silly.
-
Watch out for certain states in the U.S. too, like Arizona. They don't follow the normal Daylight Savings Time schedule.
-
Maybe it's the browser that's doing it. If that's the case, this thread may help: http://stackoverflow.com/questions/2486474/preventing-firefox-from-remembering-the-input-value-on-refresh-with-meta-tag
-
Let me know as soon as you figure it out. I've subscribed to this thread because I'm having the same problem with a custom record.
-
Or you could use the new paginated search API and keep calling it until it runs out of results, always appending the current iteration's results to a sort of master results array.
-
I need to know this too.
-
I am trying to do something like this too. Nobody answered?
-
Smaller result set generally makes the search run faster.
-
if ('usageRemaining' < 2000) Shouldn't that be a variable and not a string literal? Also, usageRemaining by itself won't work, I would think. I think it needs to be assigned from something like the below: var context = nlapiGetContext(); var usageRemaining = context.getRemainingUsage(); As long as your script has already…
-
I wonder if the Context object has the user session info.