Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Magento Cash Sale Script
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); } 0