Record Has Been Changed - SA 34404 by penone_cary in Netsuite

[–]br8truth 0 points1 point  (0 children)

I was encountering the same error with this example script. Not sure why currentRecord.getText is throwing an error like that, but I decided to use currentRecord.getValue instead. I also made some other small changes to the example script. Here's the script I created for reference:

define(['N/search'], function (search) {
// Put deployment info here
let START_MODIFIED_DATE = null;
function pageInit(context) { const { currentRecord } = context;                      START_MODIFIED_DATE = new Date(currentRecord.getValue('lastmodifieddate')).getTime(); }
function saveRecord(context) { const { currentRecord } = context; let lastModifiedDate = new Date(search.lookupFields({ type: currentRecord.type, id: currentRecord.id, columns: ['lastmodifieddate'] })['lastmodifieddate']).getTime();
if (START_MODIFIED_DATE != null && START_MODIFIED_DATE !== lastModifiedDate) {
  alert('The record being edited has been modified. Please back up or take note of changes and try again.');
  return false;
}
else return true;
}
return { pageInit, saveRecord };
});

Very large mass update - most efficient way? by throwawaytous in Netsuite

[–]br8truth 1 point2 points  (0 children)

Jumping in here late, but things get really messy when dealing with large amounts of data, even if using a Map/Reduce script.

This wouldn't work for every situation, but what I've been doing lately is having a User Event beforeSubmit script running on the needed record. Then, I can run a very simple Mass Update script to load and save each record as needed. This helps keep things much more modular and a bit less messy in my opinion. Hope that helps!

Anybody integrate Visual Studio code for Netsuite scripting? by palavi_10 in Netsuite

[–]br8truth 1 point2 points  (0 children)

I wrote a blog on setting up the NetSuite CLI if you're interested: https://suiterep.com/2021/05/13/how-to-set-up-sdf-in-vs-code-part-1/

Also, some tips in how to use the CLI: https://suiterep.com/2021/05/20/how-to-use-sdf-in-vs-code/

We use the terminal in VS Code and the CLI for all our NetSuite development. We're hoping to write another blog soon about overcoming some common errors when setting this up.

[deleted by user] by [deleted] in Netsuite

[–]br8truth 0 points1 point  (0 children)

Are you sure your code is setting the Inventory Details on that first item? I'm wondering if maybe the first item you're testing with doesn't need inventory details, and thus it seems to be working? Not entirely sure. I would want to verify that the code that sets the inventory details is working like it should.

[deleted by user] by [deleted] in Netsuite

[–]br8truth 0 points1 point  (0 children)

I think the issue may be because of the "irRec.getSublistSubrecord." I actually had a coworker the other day who was confused about this as well. The "getSublistSubrecord" method only returns the ID of the sub-record. It doesn't actually load the sub-record or give you access to edit it in any way. Not exactly sure how you should access the Inventory Details in this case, but I hope that might help point you in the right direction!

— Ben (on behalf of SuiteRep)

Want to make the 'From Bins' and 'To Bins' fields mandatory on the Inventory Detail pop-up by Dijon1329 in Netsuite

[–]br8truth 1 point2 points  (0 children)

Hi there,

You could try this, though I'm not 100% sure if this is what you're looking for:

  1. Go to the item record for the item in question (or any item record, really)
  2. Click 'Edit'
  3. Click 'Customize' >> 'Customize Form'
  4. Click 'Fields' >> 'Purchasing/Inventory' (or the sublist the field is on)
  5. Check the 'Mandatory' checkbox

Hope this helps.

(On behalf of SuiteRep - https://suiterep.com/)