gv
01/22/2025, 5:21 PMCeligo AI
01/22/2025, 5:21 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To mass apply a payment against open sales orders in NetSuite, you can use a SuiteScript. Here is a sample script that was discussed in the threads:
var payment = record.load({
    type: record.Type.CUSTOMER_PAYMENT,
    id: srch.id,
    isDynamic: true
});
var unappliedAmount = payment.getValue('unapplied');
if (unappliedAmount > 0){
    payment.selectNewLine({
        sublistId: "apply"
    });
    payment.setCurrentSublistValue({
        sublistId: 'apply',
        fieldId: 'apply',
        value: true
    });
    payment.setCurrentSublistValue({
        sublistId: 'apply',
        fieldId: 'payment',
        value: unappliedAmount
    });
    payment.setCurrentSublistValue({
        sublistId: 'apply',
        fieldId: 'internalid',
        value: openInvoices[i].id
    });
    payment.commitLine({
        sublistId: 'item'
    });
    var saveRet = payment.save({
        enableSourcing: false,
        ignoreMandatoryFields: true
    });
    log.debug("saveRet", saveRet);
}Celigo AI
01/22/2025, 5:22 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817317486
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.812322497
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.80902791
Celigo AI
01/22/2025, 5:22 PM