- is it possible to set `discounttotal` - `altsh...
# ask-stanley-ai
r
• is it possible to set
discounttotal
altshippingcost
althandlingcost manuuly via reslets in the netsuite for the sales order
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that setting
discounttotal
,
altshippingcost
, and
althandlingcost
manually via restlets in NetSuite for the sales order might not be straightforward. The
altshippingcost
and
althandlingcost
fields are typically used for display purposes and are read-only. Therefore, you might not be able to set these fields directly. For the
discounttotal
field, there is no direct mention in the conversations, but it's likely that it follows the same rules as the other fields. However, there are ways to manipulate the
shippingcost
field. For instance, you can unset the
shippingcost
field and the
shippingcostoverridden
field to allow NetSuite to overwrite the shipping cost. This can be done using a User Event Script or a Client Script. Here is a sample code snippet provided in the conversation:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 * @NModuleScope SameAccount
 */
define(["N/record"], function (record) {
  function beforeSubmit(scriptContext) {
    var rec = scriptContext.newRecord;

    var shipp = rec.setValue({
      fieldId: "shippingcostoverridden",
      value: false,
    });
    var cost = rec.setValue({
      fieldId: "shippingcost",
      value: null,
    });

  }
  return {
    beforeSubmit: beforeSubmit,
  };
});
This script sets the
shippingcostoverridden
field to
false
and the
shippingcost
field to
null
, allowing NetSuite to calculate the shipping cost automatically. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837890685
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837524474
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835327268
Please provide your feedback on this answer.