how to make Calculate Estimated Landed Cost checkb...
# ask-stanley-ai
j
how to make Calculate Estimated Landed Cost checkbox unchecked as default in item receipt
c
AI generated answer (using internal Slack threads):
To make the 'Calculate Estimated Landed Cost' checkbox unchecked as default in item receipt, you would need to use SuiteScript, as the global accounting preference only applies to new item receipts and not existing ones. You can create a User Event Script that sets the 'Calculate Estimated Landed Cost' field to false (unchecked) by default. This script would be triggered every time an item receipt is created or edited. Here is a basic example of how the script might look:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType UserEventScript
 */
define(['N/record'], function(record) {
    function beforeSubmit(context) {
        if (context.type !== context.UserEventType.CREATE && context.type !== context.UserEventType.EDIT) {
            return;
        }

        var itemReceipt = context.newRecord;
        itemReceipt.setValue({
            fieldId: 'custbody_calculate_estimated_landed_cost', // replace with the actual field id
            value: false
        });
    }

    return {
        beforeSubmit: beforeSubmit
    };
});
Please replace
'custbody_calculate_estimated_landed_cost'
with the actual field id of the 'Calculate Estimated Landed Cost' checkbox. ****** 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.808399
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808120906
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.798143804
Please provide your feedback on this answer.