Good morning :slightly_smiling_face:, does the mod...
# general
m
Good morning 🙂, does the module N/record work within a RESTlet? This is the code I'm currently using and I'm getting record is not defined and logging it gives me {} for the record
Copy code
define(['N/record'], function () {
  return {
    get: function (record) {
      log.debug('record', record);

      var currentCustomer = record.load({
        type: record.Type.CUSTOMER,
        id: 123456789
      });

      log.debug('currentCustomer', currentCustomer);
    
      var mySublist = currentCustomer.getSublist({
        sublistId: 'recmachcustrecord_customer'
      });

      log.debug('mySublist', mySublist);
    
      return mySublist;
    }
  }
});
SOLVED: The issue was that I was passing record to the get function instead of the parent function where I'm defining the record module