i have a MR script to apply customer refund from c...
# suitescript
v
i have a MR script to apply customer refund from credit memo. Below is my reduce function function reduce(context){ var parsedValues = JSON.parse(context.values[0]); log.debug('parsedValues',parsedValues); var parsedValuesCreditMemoInternalId = parsedValues.values['GROUP(internalid.transaction)'].value; var parsedValuesCustomerID = parsedValues.values['GROUP(internalid)'].value; log.debug('parsedValuesCustomer',parsedValuesCustomerID); log.debug('parsedValuesCreditMemoInternalId',parsedValuesCreditMemoInternalId); var rec = currentRecord.get(); log.debug('rec',rec); var refundRecord = record.create({ type : record.Type.CUSTOMER_REFUND, defaultValues : { customer : parsedValuesCustomerID } }); log.debug('refundRecord',refundRecord); /*refundRecord.setSublistValue({ sublistId : 'apply', fieldId : 'apply', value : true, line : 0 });*/ var refundRecordID = refundRecord.save(); log.debug('refundRecordID',refundRecordID); var refundRecordLineCount = refundRecord.getLineCount({sublistId: 'apply'}); log.debug('refundRecordLineCount',refundRecordLineCount); } In this i am not able to get the log, meaning it is not creating a record.But i can do it manually. what could be the reason?
n
Did you see any of your log.debug logs?
If you're sure you're getting in to the map and it's throwing errors (or even you're not sure), then ensure your summarize step includes outputting map errors.
Copy code
const summarize = (summaryContext) => {
    log.error('Input Error', summaryContext.inputSummary.error);

    summaryContext.mapSummary.errors.iterator().each(function (code, message) {
        log.error({title: 'Map Error : ' + code, details: message});
    });
}
v
what is this inputSummary and mapSummary?
n
^^ that will output error(s) that occurred in the input / map stages.