My Stuff
Comments
-
I had to turn this function off, it was throwing an error to some users in Chrome, but not to me. The error is seems to be user-dependent, but not role- or computer-dependant... hmmm... An unexpected error occurred in a script running on this page. init (pageInit) customform JS_EXCEPTION TypeError Cannot set property…
-
Yep, that space was the problem, thanks it works great in chrome.
-
Thanks James - I couldn't get that to work using Chrome. Is that IE only?
-
Something like this should work, but please be very careful, you are deleting records and if this script is misapplied, you will cause irreversible damage. I added a line to this script that forces you to use the exact name of the custom record that you are deleting. function after_submit(type) { var custom_record_name =…
-
You could do this with a User Event script: beforeLoad, check for allowed role & user combinations.
-
If I understand correctly, this is only for cases where the script has been interrupted and <3 records were created. Which way are the loops nested? Is it Item first, then each Location? If that's the case, you might add summary criteria to the saved search, count of 'Item Inventory History' records <3. Alternatively, you…
-
I agree with the Suitelet, but if you already have it working with the custom record and are looking for a quick solution, you could create a very simple script that deletes the record nightly, or immediately.
-
My suggestion is to check for conflicting/overriding permissions in all these places: [LIST] [*]On the custom record 'Permissions' tab [*]On the custom record 'ACCESS TYPE' field [*]On each custom field on the custom record [*]On the role record [*]On the user/employee record [/LIST]
-
A beforesubmit could catch it too. You could have a custom field (list) on the employee record for this type of permission, and then restrict new records based on this custom field.
-
When you say 'customers being able to find them' do you mean through the webstore, or are the customers logging in with a Customer Center role? If it's the former, just remove the items from the webstore. If it's the second, you can try using 'Inactive' on the item, and make sure the role can't see inactive items.
-
Maybe a saved summary search, with a count of related items
-
You can run a saved search in javascript through the api and use your results as a variable.
-
You might have to use a scheduled script and suffer the 15 minute lag.
-
It sounds like you've created a Client script, you might want to consider this as a User Event script, which gives you the ability to limit to type=create. If you want to stick with a client script, there are a couple ways to do what you want. You can check to see if the field is empty, and then set it (see below). Or you…
-
You can hard code it again, or use nlapiResolveURL(type, identifier, id, displayMode) or other Application Navigation APIs to get the proper subdomain. https://system.na1.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3059898
-
Can you post your full script? If not, add some nlapiLogExecution(type, title, details) lines to find where the script is encountering errors.
-
Try this code, and then you should be able to see if there are any variables that aren't getting the proper value, and you'll narrow down exactly which line is throwing the error function scheduledScript() { var searchid = '2921', searchresults = nlapiSearchRecord('transaction', searchid); if (searchresults !== null) {…
-
To speed up testing in a scheduled script, create a new deployment of that script, making sure the keep the status as Not Deployed. Save it. Then edit it, and click Save and Deploy. It will be immediately added to the queue of scripts, no longer a need to wait for the scheduled time.
-
Hi. For issue 1, consider changing this to a user event script (before submit) so that dependent fields can be updated. This will have an added benefit of running on records not created thru the UI. You do have to change the functions from getcurrentlineitem to getlineitem and specify the line number, but this is also much…
-
Ok that makes sense... User Event scripts will not trigger other UE scripts or client scripts, so you will have to go back to the client script (or possibly a scheduled script). Hopefully you can get the client script to work using variables and not exiting the loop prematurely.
-
Glad you figured this out. Adding in a bunch of debug lines will often help find the needle in the haystack! As for scaling the script, there are ways to accomplish what you are trying to do. You could create 12 searches but use only a single script, by having the script id's, fieldnames, etc in arrays, then loop the…
-
I believe this is a read-only field, calculated by NetSuite.
-
'Apply WH Tax ?' {custcol_4601_witaxapplies} appears to be a custom field... how exactly does it trigger the WH tax to calculate, is there another script or workflow?
-
You're on the right track, but nlapiGetNewRecord is going to cause you problems [h=2]nlapiGetNewRecord()[/h] Available in beforeLoad, beforeSubmit, and afterSubmit user event scripts. You are not allowed to submit the current or previous record returned by nlapiGetNewRecord. Your code would be cleaner without reloading the…
-
I agree with pcutler this should be done server side, avoiding unpublished API. The trick on server side is to trigger the script only after once, when the copy button is used, otherwise the script will clear all lines every time that you edit the record. I believe you can use nlapiGetRecordId() to determine if this is a…
-
Try the 'Item' field in criteria, this worked for me in a test.
-
Hey thanks for that, I never realized there was a type = copy. I'll have to go back into my scripts and clean that up.
-
With your latest code, you're no longer checking for nlapiGetFieldValue('custbody_containerbillcount') != '' so that's probably the difference.
-
I'm not suggesting that you run this on a client... I'm showing how to get the list of all fields on a record for reference, instead of guessing what they might be.
-
My guess is that nlapiGetFieldValue('custbody_containerbillcount') is NULL, but debug it like this: function onFieldChange(name){ <strong> var containerbillcount = nlapiGetFieldValue('custbody_containerbillcount'); nlapiLogExecution('debug', 'name', name); nlapiLogExecution('debug', 'containerbillcount',…