My Stuff
Comments
-
jmessersmith - how are you accessing the values in those fields within your script?
-
I seem to recall trying to do client scripts on assembly items a long time ago, and not being able to - I think it may be simply a defect / enhancement request that you cannot do so, not sure if there's a workaround.
-
You are welcome, my friend :)
-
Hey Joao - I realize that wasn't super clear. 'sale' in my code is a reference to the nlobjRecord instance of the transaction (sales order in my case): var sale = null; try { sale = nlapiLoadRecord('salesorder', soId); } catch(e) { nlapiLogExecution('DEBUG', 'createdfrom', soId); nlapiLogExecution('DEBUG', 'not created…
-
Do you have a 'minimum quantity' set on the item record?
-
The following is a script I wrote for sending a fulfillment email. Hopefully it helps you out some. var emailTemp = nlapiLoadRecord('emailtemplate', conf.templateId); var emailSubj = emailTemp.getFieldValue('subject'); var emailBody = emailTemp.getFieldValue('content'); var renderer = nlapiCreateTemplateRenderer();…
-
I think you wanted continue; instead of return;
-
Yup, to pass in the value to the library function, simply call the library function from your main scheduled script function: essentially, the scheduled script function a shell that does little more than call the library function (and does whatever else you might want it to do). Note: the "type" param in the scheduled…
-
I'd recommend using a library script - create one file containing the function(s) you want to repurpose, and on the script record(s) in NS, add it as the library file.
-
Awesome! Glad you got this working cgieselman
-
It shouldn't throw an error if null, just pass in null literally when you call it in the UE script. Alternatively, grab nlapiGetRecordId() first and pass that to boupdate in the UE script. Either way should work just fine.
-
-1 is different from 0 I believe; it implies that the sublist doesn't exist, where I think 0 would imply that it's there, but contains no sublist items. khultquist that's something I hadn't thought of - this definitely could be why it's not logging! bradsimpson - is this running on Create of the record, or Edit? Both? If…
-
Gotcha. You may need to pass through the ID of the transaction record and instantiate it in the client script, since it probably will have lost its connection to it in the call via the button.
-
That won't work, since the function 'boupdate' isn't a method of the nlobjRecord API. Why not just pass the ID to the function and load the record inside of there?
-
bradsimpson that is very interesting. To me it implies maybe a difference of Edit mode being a "dynamic" mode for the record, and thereby allowing the API methods such as "nlapiGetLineItemCount" to work properly. Perhaps if you switch your code around to loading the record anew via nlapiLoadRecord, and then looping through…
-
Are you looking at the Client Script deployment? Make sure you're not accidentally looking at the User Event script...that trips me up sometimes when using the UE button -> CS script pattern you're doing here. Short of that, can you send screenshots of your script + deployment records? Alternatively, you could try using…
-
OK, I figured it out. Apparently the param "&id=" needed to be "&custparam_id=". Something about the use of the "ID" parameter was screwing it up.
-
The likely culprit is that at the time of execution, there are no items in the "salesteam" sublist. To verify that this is the problem, see what value this returns: nlapiLogExecution('DEBUG', '# of salesteam items', nlapiGetLineItemCount('salesteam')); Also, what type of script is this running in? Judging by your function…
-
I don't know about adding it to the "menu" but I would approach it by making a custom portlet script. You could have the portlet simply contain a button or link to trigger the scheduled script.
-
Anytime - cheers!
-
You say you are using a service item - I'm not sure if that will work as NetSuite specifically mentions using a non-inventory item, but it may. This article should help: https://netsuite.custhelp.com/app/answers/detail/a_id/35131/kw/assembly%20labor%20item A couple things that were important for me when I started doing…
-
Ah, good to know - thanks for the update!
-
I'm guessing you tried addParamToURL('target', '_blank') and that didn't work?
-
Ahhh, sorry to have misunderstood. In that case, I wonder if what is missing is that you might first need to call nlapiSelectLineItem('component', line); before altering the line's quantity field? I feel like it needs to be selected prior to committing. See if that helps. ...but, you said it actually updates the field just…
-
Ah, that makes sense - I haven't used these functions before, so I was admittedly grasping at straws.
-
I definitely don't think setting "override" is the answer. I have not done much scripting in "standard mode" but I wonder if you try using dynamic mode, maybe it will work as long as you edit the subrecord after the customer field is set (and fields sourced)? It seems likely that when the customer is set in your script,…
-
lol https://xkcd.com/979/ this all day
-
I wish they would work harder on fixing current bugs then informing us of how to fix 9-year-old issues that likely were already solved.
-
When you find a gap in NetSuite you should get a prize or something. Maybe unlock an achievement.
-
Sounds like you may want to use Customer Deposits - create your sales orders as though they will generate an Invoice rather than a cash sale, then create a deposit against the sales order using the credit card info.