My Stuff
Comments
-
Cancel does not capture a person just closing the screen. There's no way to account for that. You can make a time based assumption, yes, akin to "if user stamp is older than x minutes, disregard lock". That's a assumption, though. So if someone is just taking his time making a change, there's no way to account for that.…
-
To achieve this, you'll need to change approach. You won't be able to use copy record. You would need to use a client-side script that does window.open() to pop your new window, calling the New Record task link. The code that will populate your fields will be either a pageInit script or a beforeLoad script. Note that…
-
What trigger is this on, by the way? onSave?
-
The client script will be way easier, but you'll need to press Edit to see the button. A button in view mode will more closely mimick the real button, but you'll have more coding on your hands.
-
Why don't you use a for() rather than a while() loop? for(var i=1; i<=nlapiGetLineItemCount('item'),i++){ nlapiSelectLineItem('item',i); nlapiSetCurrentLineItemValue('item', 'price', nlapiGetFieldValue('custbody2'), false,true); nlapiCommitLineItem('item'); }
-
We are currently working on doing this for a customer. In their case the integration between NS and the mobile device includes A LOT more than just signature capture, but signature capture is in there. It's definately possible and not that technically complicated, really.
-
Did you ever get this resolved? I'm having the same issue on a beforeSubmit user event script - nlapiGetOldRecord() returns null, and I was expecting it to have the values prior to update. nlapiGetNewRecord() works fine.... Are you in the beforeSubmit of a creation? There is no old object in this case. That'd be the most…
-
I would recommend filtering by your lowest internal id, not sorting (or rather, you do need to sort - you just also should be filtering). Using filtering you save yourself needless processing time. Also, if you don't filter by lowest internal id, your result set will become clogged up with records you've already processed.…
-
Hmm.. I have seen some exceptions like you mention, but these are rare. Is your scenario that you press the yellow Approve button? I think using yellow buttons for status changes (Mark Pick/Packed/Ship, Approve, etc) don't deal well with an aftersubmit nlapiGetFieldValue() but that should be the only cases.
-
If you need to set fields, then yes you'll need to load and submit. If you're just reading fields (which is what i saw in your snippet) then you don't need to submit nor load.
-
if(searchresults!=null){ for(var i=0; i<searchresults.length; i++){ ... } }
-
The 2nd line syntax is correct, assuming 5 is the correct internal id of your location.
-
Meh. the searchresult would be an object, doing if(searchresult) wouldn't really tell you anything useful in most cases. Just checking if it's not null is what we use in all our scripts.
-
I don't know. My guess is yes, it would wait. But try it out and let us know
-
afterSubmit should work
-
Thanks for the correction Brett :)
-
quantityTotal = quantityCartonLine++ should be quantityTotal += nlapiFormatCurrency(quantityCartonLine); You could put the script on field change, but I recommend on recalc otherwise your script will miss the event of a line being removed. However, you'll want to restrict the script thus: function onSaveCustFieldChg(type)…
-
Ah, you create SOs. Yes, that will take a few seconds to do. However, your scripts can probably be optimized. 8 seconds of processing seems like a long time - but then again I don't know what's on the SO (how many lines, etc). But right off the bat, you're doing what looks like an unecessary record load of your current…
-
Can you optimize your scripts?
-
Stick it in your file cabinet and make it available without login (just that one file!), then paste the link.
-
Getting tough to debug based on posts only. If you want you can try posting a bunch of screenshots of your deployment, maybe I can spot something. Edit: One of my eagle-eyed collegues pointed something out. There might be a problem with your custom field names. "'custcol_custcolitemtest1" and "'custbody_custbodytesttotal1"…
-
hmm, go with the below code: function onSaveCustFieldChg(type) { if(type=='item') { var quantityTotal = 0; for( var i = 1; i <= nlapiGetLineItemCount('item'); i++) { var quantityCartonLine = nlapiGetLineItemValue('item', 'custcol_custcolitemtest1', i ); if( isNaN(quantityCartonLine) || quantityCartonLine == null ||…
-
Hmm, quantityTotal was never declared or initialized, which might be the problem. You were also missing a closing bracket. Try - function onSaveCustFieldChg(type) { if(type=='item') { var quantityTotal = 0; for( var i = 1; i <= nlapiGetLineItemCount('item'); i++) { var quantityCartonLine = nlapiGetLineItemValue('item',…
-
Here is something to get you started: https://usergroup.netsuite.com/users/showthread.php?t=27558
-
There is a Partner field on Customer record. You simply need to set this field to the appropriate value. nlapiSetFieldValue('partner',whatever) or record.setFieldValue('partner',whatever), depending on your execution context.
-
So the biggest question, right now, I think, is how to get the custom body field to appear - all the time? (Obviously with the correct total in it!). sara Sara, can you post a screenshot of your custom field definition please?
-
Ahh.. I think you should review the documentation. There's too much stuff to cover from User Group posts. Check the following Help topic: SuiteFlex (Customization, Scripting, and Web Services) : SuiteScript : Understanding NetSuite Script Types : Suitelets. Read all that and see if that helps any. I think you're confusing…
-
Can you post your code?
-
You'll probably want to use nlapiTransformRecord() to initialise the payment from an invoice.
-
I seriously doubt plugging the script as a Library will work without a lot of adaptation. Let's say you've got a beforeSubmit() function on your customer - those all use nlapiSetFieldValue() and stuff - that API is relative to the current record, which in this case is most certainly NOT your customer record. So anything…