there was an issue with a bunch of cash sales we w...
# suitescript
s
there was an issue with a bunch of cash sales we would like to set the istaxable check box to false the question is two-fold we are trying to create saved search for those cash sale where istaxable is true and it doesnt seem to come up 2nd this is the current code which doesnt seem to work
Copy code
var data = JSON.parse(context.value);
    log.debug("testing ..", data);
    try {
      record.submitFields({
        type: record.Type.CASH_SALE,
        id: data.id,
        values: {
          istaxable: "F",
        },
      });
    } catch (error) {
      log.debug("testing ..", error);
    }
a
It appears
istaxable
isn't available as either a search filter or column per the record browser https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2023_1/script/record/transaction.html and it also appears that for cash sales
istaxable
cannot be targeted by submitFields https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2023_1/script/record/cashsale.html so... you're gonna have to come up with other search filters, or maybe you could switch to using the n/query module? and then when you have your result set you're going to have to load the record, get the value of
istaxable
and if its not false then set it to false with a setValue, and then do a
record.save
w
You should always be able to use record.submitFields() if you want to. But if it cannot do an XEDIT on the field, it will load, edit and save it automatically. That is at least according to the documentation of it's predecessor nlapiSubmitFields(). Consequences of Using nlapiSubmitField on Non Inline Editable Fields
@Sim Greenbaum booleans are set with booleans in SS2. Try
Copy code
record.submitFields({
    type: record.Type.CASH_SALE,
    id: data.id,
    values: {
        istaxable: false,
    },
});
s
i have map reduce function that i need to shutdwon any ideas
w
Undeploy/inactivate the deployment that is running. It will stop once it yields.
s
so if it yields every 60 min then it will stop then ?
a
it really depends how the script is setup and how many map/reduce instances need to get scheduled etc.
w
It yields either after 60 minutes (if that is your set limit) or if an instance hits the soft limits for map/reduce Jobs