Hi is there a way for me to enter custom value for...
# general
k
Hi is there a way for me to enter custom value for shipped date for item fulfillment record creation? Currently the pick / shipped date is based on when the item fufillment record is created, but I need to be able to customized that date.
m
Try with a workflow and formula
a
you can create custom field to have custom date and create Suitescript to auto populate new date.
Copy code
* @AppliesTo Record Type: Item Fulfillment
 */
define(['N/record'], function(record) {
    
    function beforeSubmit(context) {
        var newRecord = context.newRecord;
        var shippedDate = new Date('2022-02-20'); // Replace this with your custom shipped date
        
        // Set the shipped date on each item line
        for (var i = 0; i < newRecord.getLineCount({sublistId: 'item'}); i++) {
            newRecord.setSublistValue({
                sublistId: 'item',
                fieldId: 'shipdate',
                line: i,
                value: shippedDate
            });
        }
    }
    
    return {
        beforeSubmit: beforeSubmit
    };
    
});