Outgoing Payments with check payment primary form items via DI-API

436 Views Asked by At

I'm trying to add an OP with check payment with a primary form item but after saving the payment the chosen CFWid won't reflect in SAP but instead shows the default cash flow.

I have successfully added an OP with Bank Transfer Primary form items, using the code below (both using same GL account - with cash flow relevant checked.)

oPay.PrimaryFormItems.CashFlowLineItemID = Int32.Parse(row["CFWId"].ToString());

if (row["PaymentMen"].ToString() == "BTR")
{
    oPay.PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtBankTransfer;
}
else if (row["PaymentMen"].ToString() == "CHK")
{
    oPay.PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtChecks;
}
1

There are 1 best solutions below

0
Jose Daniel Zapata Rivera On

Use this code

for (int c = 0; c < oPago.PrimaryFormItems.Count; c++) {
    oPago.PrimaryFormItems.SetCurrentLine(c);
    oPago.PrimaryFormItems.CashFlowLineItemID = PAFCId;
}