Hi,
We currently have a suitelet which we pass in a json string to create a sales order and now that the sales order is created we would like to mark a cash sale record against it so we can see some funds have come through to the account.
Originally we had a webservice script running which would create a sales order, then an additional request would fire through to Netsuite which would create a cash sale record bound to the internal ID of the sales order and internal id of the account.
We have since been trying to make this work via a suitelet, however each time we are recieving an error stating
"INVALID_RCRD_TRANSFRM That is not a valid record transformation. [Ljava.lang.String;@24bc48a"
I can see each new sales order we have created has the status of pending fulfillment. Is this something that could be getting in the way ?
The sales orders are being created correctly,
Below is our code for creating an additional cashsale record
function CreateCashSale(objData)
{
try
{
var csObj = objData.data[0];
dLog('CreateCashSale', 'csObj = ' + JSON.stringify(csObj));
var rec = nlapiTransformRecord('salesorder', csObj.so_internal_id, 'cashsale');
rec.setFieldValue('undepfunds', 'F');
rec.setFieldValue('account', csObj.account_id);
var cashsaleID = nlapiSubmitRecord(rec, true, true);
dLog('CreateSalesOrder', 'Created Cash Sale : Id = ' + cashsaleID);
objResponseData.internal_id = cashsaleID;
}
catch (e)
{
var stErrMsg = '';
if (e.getDetails != undefined)
{
stErrMsg = e.getCode() + ' ' + e.getDetails() + ' ' + e.getStackTrace();
}
else
{
stErrMsg = e.toString();
}
dErr('CreateCashSale', stErrMsg);
objResponseData.status = "FAILED";
objResponseData.response_message = stErrMsg;
objResponseData.response_code = "99";
objResponseData.internal_id = '';
}
return objResponseData;
}
// end function