I am using Netsuite SuiteTalk PHPToolKit and trying to create vendor payment record using php soap call.
Request:
$vendorPayment = new VendorPayment();
$vendorPayment->entity = new RecordRef();
$vendorPayment->entity->internalId = $bill->entity->internalId;
$vendorPayment->entity->type = 'vendor';
$vendorPayment->account = new RecordRef();
$vendorPayment->account->internalId = self::SB_ACCOUNT_INTERNAL_ID;
$vendorPayment->apAcct = new RecordRef();
$vendorPayment->apAcct->internalId = $bill->account->internalId;
$vendorPayment->customForm = new RecordRef();
$vendorPayment->customForm->name = $bill->customForm->name;
$vendorPayment->subsidiary = new RecordRef();
$vendorPayment->subsidiary->internalId = $bill->subsidiary->internalId;
$vendorPayment->tranDate = time();
$vendorPayment->memo = 'Testing Memo';
// Create a new instance of the line item.
$lineItem = new \NetSuite\Classes\VendorPaymentApply();
$lineItem->apply = true;
$lineItem->type= 'Bill';
$lineItem->refNum = $bill->tranId;
$lineItem->amount = 30.00;
// Add the line item to the vendor payment record.
$vendorPayment->applyList = new \NetSuite\Classes\VendorPaymentApplyList();
$vendorPayment->applyList->apply = [$lineItem];
But I am getting an below error
Adding new line to sublist apply is not allowed.
Is anyone have an idea how to do it please help me here.
Thanks in advance.