My Stuff
Please note that on Friday, October 10, 2025, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 2 hours. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Share Your SuiteWorld Experience & Earn a Special Badge!
Comments
-
What is your script doing, exactly?
-
Client side scripts will NOT get called. User Event scripts will get called, with the 'pack' and 'ship' event types (so if you were looking at 'edit', you would indeed not catch it).
-
Here is what I have now: function appendName() { var recordType = nlapiGetFieldValue('Record'); if (recordType == 'Create') { //this gets the employee who wrote/requested the order var orderReq = nlapiGetFieldValue('employee'); if (orderReq == '') { //do nothing } else { //this loads the employee record var employeeRecord…
-
I would build a key using several line values - item, rate, amount, etc - whatever uniquely identifies a line.
-
Keep in mind if you are using User Event script new Date() will return the server date which is in Pacific time. You can use the search function to find some threads discussing how to deal with this, if that is a concern.
-
Not necessarely. You could create a Custom Record mathing the layout of your raw CSV, and import the entire file straight into that record. You would then have a user event suitescript on the custom record that upon creation would transform and write the data into the appropriate record. It may also be worthwhile, since…
-
Hmm, try these (in that order) 1. Change to nlapiGetCurrentLineItemValue() 2. Change code to postSourcing rather than field change
-
Right, so that this tells us is that Voiding transactions comes in as an edit, so you won't be able to rely on the type to figure out it was a void. Maybe try checking the order status?
-
Hmm, that's a good question. I recommend you stick a nlapiLogExecution('debug','type',type) as the first instruction in your code and press the button, see what comes out. Best way to know for sure!
-
price is the column for Price Level. You want to set rate. However, you have to set the price to custome before being able to set the rate. You probably also want to validate the values in your equation to avoid divisions by 0 or empty strings. Also, you're just calling variables in the form of the field names, which will…
-
Hmm. Try moving your code to client-side PageInit trigger instead.
-
IIRC correctly sorting is not yet supported on suitelets
-
If you want only 1 result, you must filter you nlapiSearchRecord so it only returns 1 result.
-
nlapiGetRecordId(), but note that this will be null if you are creating the record
-
Yeah having an API to call a modal box à la timeout screen would be awesome.
-
Yeah, well, the programmic gets a bit more complicated then. The simplest thing would probably to add some if() statements inside the for() loop and check "did i already add number?" and then ignore it if you did, etc. What programmers do usually is map out the logic we need to do using pseudo-code or little drawings and…
-
Ahh, now comes the real fun. You see, the XmlToPdf API requires you to pass it properly formatted XML, right. Problem is, a lot can go wrong here, little syntax problems can easily occur. The API, however, simply tells you "something is wrong". No further details. So now comes the fun part of hunting down where the syntax…
-
I think nlapiGetCurrentLineItemValue("item","taxcode") can return null, and null.length would give an error. What exactly is it you're doing here, trying to avoid fieldfire true if you add the tax code to an empty value? I'd recommend going with the stardard var currentCode = nlapiGetCurrentLineItemValue("item","taxcode");…
-
Coding suitescript and javascript on your web store are two completely different things. 1. You don't nee script tags 2. Do not use <% %> nomencalture. Refer to the Suitescript Deveollper APIs for proper APIs to use (in this case, nlapiGetLineItemValue() 3. You'll probably want to review how to deploy scripts as well, to…
-
var record = nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId()) record.setFieldValue('fieldname',value) nlapiSubmitRecord(record) You can also use nlapiSubmitField() if you are editing only a few fields. You cannot use nlapiGetNewRecord() because it returns a read-only version of the record. You can refer to the API…
-
Yeah, it's possible. I think what you're saying is that your layout isn't coming out like you want it. That's not much of a problem, just tweak your table a bit to get it to come out right. You'll also need to tweak what's in your for() cause you don't want to output number all the time, etc.
-
I don't think 482 is a valid location id. You need to double check what the internal id of the location you want is.
-
Myeah... you have a lot of fundamental problems in there. So, do you understand that "for(var i=0;i<results.length;i++)" is iterating through the result set returned by your nlapiSearchRecord()? The way the search is now, it returns many lines per item receipt, and it can return many item receipts. So your index i…
-
var record = nlapiLoadRecord('itemreceipt', null); var filters = new Array(); filters[0] = new nlobjSearchFilter( 'type', null, null, 'itemreceipt' ); filters[1] = new nlobjSearchFilter( 'location', null, , null, locationid); So you're kinda in the right direction. the above chunck should be something like var filters =…
-
In client-side, yes. Native javascript supports alert() confirm() and input() If you need more complex popups, it becomes far more complex. You can either pop a suitelet in a new window, and then you have to transfer the values upon submit, or use a library like jQuery to pop a complex modal window based on DIV elements…
-
Hmm... try nlapiRedirectURL() to itself?
-
On the script deployment, did you tick in Run as Admin?
-
Just put afterSubmit script on Lead type=='create' and create a new transaction. You don't need a suitelet.
-
This isn't the sort of thing you'd normally use suitescript for so it's not straightforward. If you wanted to do that, I would use a inline html field to source the item name and wrap it in a green color tag. Otherwise you have to hack the DOM to force a new color. This method is not supported and not recommended.
-
nlapiSetRedirectURL() my friend :)