My Stuff
Nominate Your Peers for NetSuite Support Community's Choice of the Quarter! Submit your nomination today.
Intelligent Payment Automation version 1.0.3 is now available in the SuiteApp Marketplace. The SuiteApp, powered by BILL, lets you automate payments, manage vendor details, and bank account information within NetSuite. Learn more
Comments
-
Try afterSubmit(type) { var author = "28" var recipient = "28" var subject = "New Hire Notification" var body = "We hired a new associate." if (type == 'Create') { nlapiSendEmail(author,recipient,subject,body); } }
-
What are the error and the effect you are getting?
-
Well, I may be stating the obvious, but it looks like your script jammed on line 14 and caused a timeout. Maybe you just had too many orders to process this morning, too. Do you have more details on the error, such as what is on line 14?
-
Department, Class and probably tax code, too, require internal ids, not text values. You can find the internal id by looking at the records for these objects, it's in the URL.
-
Generally, when I get errors like "Cannot find function getFullYear" (which I did get not long ago), it's because there is an error in my script, not because the function is not actually found. There is nothing you cannot do with SuiteScript that you can normally do. Just post your code here, this group is great for…
-
Is manufacturer tariff a custom field? If it is you got its name wrong, since it would necessarely begin with custcol or custbody depending where it's placed. If that's not it, are you sure you have a current line? Where is this being called from?
-
Yes, I'm pretty sure you do. You would need to calculate those values by using a Search to sum last year's invoices/this YTD's invoices. I don't really see how else you could pull it into a field.
-
So the code is on Validate Line?
-
I don't think you can override that and I don't think you'd want to if you could. Can you detail your use case more? Why are you writtin directly into the sum tax field? Why can't you set the taxes at the in the line item fields and let NS calculate it from there?
-
You can't normally set the Tax Rate in Netsuite, you need to set a Tax Group (or Code) which has the correct rate defined in it.
-
Hmm... try placing some logs function setAuthorisation(type) { nlapiLogExecution('debug','type',type); if (type == 'create') { var record = nlapiGetNewRecord(); var originator = record.getFieldValue('originator'); nlapiLogExecution('debug','originator',originator); nlapiLogExecution('debug','originator…
-
Ah yes, I see your problem - different computer can have different date formats, so sticking the Netsuite date into a Date() will result in variations in interpretation. I think you can solve this using nlapiStringToDate(). Here is the excerpt from documentation: nlapiStringToDate(str) Converts a String to a Date object…
-
Use getDay() Here is a reference site I use for javascript functions, hope it helps.
-
Well, you could fire nlapiLookupField(record, id, 'internalid') and see if that returns anything, or run nlapiSearchRecord() on the internalid. Personally though I would avoid the extra metering and simply wrap your write attempt in a try/catch and handle the error in whatever way you want - ie ignore it or warn the user,…
-
You didn't explicitly state, but is this running as a Before Submit or After Submit script (it needs to be before)?
-
Is that script not working?
-
No, he wants a method that would return an array of all line items (of a certain machine, eg 'item') from a specified record. This would be a shortcut call to first opening the record and then iterating through the lines. It could save some metering units. Not a bad idea, I say 'why not'.
-
You'd probably want to use window.open(), and perhaps document.writeln() to transfer information. This kind of stuff isn't covered by Netsuite documentation, but you can google yourself some helpful sites pretty easily.
-
Hi, use parseFloat() or pareseInt() to stop variables being treated as strings. Example: whoprice= parseFloat(salescost) + parseFloat(subtotal); Cheers!
-
In a client script, it is indeed possible to set a select option via text - nlapiSetTextValue(). You can't do that from Server-Side or if using a nlapiRecord object. As far as I know, it isn't possible to get all the value pairs of a list. Not easily, anyway.
-
Steve, I have the answer for you. You need to add the following code: for(i=1;i<=fulfillment.getLineItemCount('item');i++) { fulfillment.setLineItemValue('item','itemreceive',i,'T'); fulfillment.setLineItemValue('item','quantity',i,fulfillment.getLineItemValue('item','quantityremaining',i)); }
-
nlapiLoadRecord and nlapiGetNewRecord both create a Record object, so it will not affect the rest of your code. A warning, though - // Get the Previous Sales Order Record var previousRecord = nlapiGetOldRecord(); will not work if you are Creating a record, as there is no old record. You should probably restructure your…
-
Ok, try this. On afterSubmit, instead of getting nlapiGetNewRecord(), do nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId()). I think the problem is GetNewRecord does not have your tranId commited yet. If you do a full record load, it'll probably be there.
-
Are you running this on a beforeSubmit or afterSubmit? If it is beforeSubmit and the save is coming from the creation of a new SO, those values may not exist yet. Did you check what values your variables had?
-
Yes, I think you should be able with Validate Field. Basically throw an Alert() on validate until the value is correct.
-
Nothing sources when you set line items from server-side. You have to set the transaction subtotal, the total, tax totals, etc. You also have to set the line item fields as Amount. Right Yang? Or did that change?
-
Oddly enough in the intervening nine years and eighteen NetSuite version changes I did indeed find my answer. Thanks.
-
Unexpected Error. No other details...
-
Any news on this?
-
Yang, still getting an Unexpected error after this weekend. Did the fix go in? Or am I looking at another unrelated problem?