Hi,
We have moved our second site to Magento and using Celigo. The problem is Celigo will not create Cash Sales...So decided a script might do it.. again scripting is still new please could someone check this script?
I want to look at the Sales Order - Custom Tab -> Magento Payment Method if this is 'sagepaydirectpro' then to automatically create a cash sale with Payment Method 'Magento'.
function afterSubmit(type) { var itemDetails = nlapiSearchRecord('salesorder') //Check Sales Order Magento Payment Method// if (nlapiGetFieldText('custbody_celigo_magento_pay_meth')== 'sagepaydirectpro') var newId = nlapiGetRecordId(); var cashsale = nlapiCreateRecord('cashsale'); cashsale.setFieldValue('entity', newId ); cashsale.setLineItemValue('item', 'item', 1, 23); cashsale.setLineItemValue('item', 'quantity', 1, 1); cashsale.setFeildValue('paymentmethod', 'Magento'); var id = nlapiSubmitRecord(cashsale, true); }