Nand Pandey
12/19/2019, 9:25 AMvar createCustomerRefund = record.create({
type: record.Type.CUSTOMER_REFUND,
isDynamic: false,
defaultValues: { entity: creditMemoId.getValue("entity") }
});
createCustomerRefund.setValue({
fieldId: 'entity',
value: creditMemoId.getValue("entity")
});
createCustomerRefund.setValue({
fieldId: 'customer',
value: "34959"
});
//var paymentmethodData = paymentmethod.getPaymentMethods({ "partyId":partyId });
createCustomerRefund.setValue({
fieldId: 'paymentmethod',
value: 11
});
var configurations = config.load({
type: "companypreferences"
});
var accountId = configurations.getValue("custscriptaccountid");
createCustomerRefund.setValue({
fieldId: 'account',
value: accountId
});
var numLines = createCustomerRefund.getLineCount({
sublistId: 'apply'
});
log.debug("numLines:::::", numLines);
for (var i = 0 ; numLines > i; i++) {
var id = createCustomerRefund.getSublistValue({ sublistId: 'apply', fieldId: 'doc', line: i })
if(id == creditMemoId.id){
createCustomerRefund.setSublistValue({
sublistId: 'apply',
fieldId: 'apply',
value: true,
line: i
});
log.debug(
i + 'line:::::: ' +
createCustomerRefund.getSublistValue({ sublistId: 'apply', fieldId: 'doc', line: i }) + ' ' +
createCustomerRefund.getSublistValue({ sublistId: 'apply', fieldId: 'apply', line: i }) + ' ' +
createCustomerRefund.getSublistValue({ sublistId: 'apply', fieldId: 'amount', line: i }) + ' ' +
createCustomerRefund.getSublistValue({ sublistId: 'apply', fieldId: 'total', line: i }))
}
}
return createCustomerRefund.save();battk
12/19/2019, 9:35 AMbattk
12/19/2019, 9:36 AMcreateCustomerRefund.setValue({
fieldId: 'entity',
value: creditMemoId.getValue("entity")
});
createCustomerRefund.setValue({
fieldId: 'customer',
value: "34959"
});battk
12/19/2019, 9:42 AMbattk
12/19/2019, 9:43 AMvar createCustomerRefund = record.create({
type: record.Type.CUSTOMER_REFUND,
isDynamic: false,
defaultValues: {
entity: creditMemoId.getValue("entity"),
cred: creditMemoId.id
}
});Nand Pandey
12/19/2019, 9:44 AM