user3682707
user3682707

Reputation: 267

Cannot Update Amount when Initialize Vendor Payment (Suitetalk)

I have code to Create a Vendor Payment for aVendor Bill like this :

InitializeRecord ir = new InitializeRecord();
ir.type = InitializeType.vendorPayment;
InitializeRef iref = new InitializeRef();
iref.typeSpecified = true;
iref.type = InitializeRefType.vendorBill;
iref.internalId = vendorBillId;
ir.reference = iref;

Login();
ReadResponse getInitResp = _service.initialize(ir);

if (getInitResp.status.isSuccess)
{
    Record rec = getInitResp.record;
    ((VendorPayment)rec).total = (double)amount; //I don't want to pall all, just pay a half or just an amount less than the total
    ((VendorPayment)rec).totalSpecified = true;
    WriteResponse writeRes = _service.add(rec);
    return writeRes.status;
}

That can create a payment but the total is not apply, the payment is pay all amount of vendor bill's total.

I don't know what I'm missing here.

Upvotes: 0

Views: 392

Answers (1)

prasun
prasun

Reputation: 7343

While applying payments to bill you cannot change the body level amount field. you got to change the amount line level field on apply line item record. I am not sure on syntax in Suitetalk, but, that should work.

Upvotes: 1

Related Questions