Skip to main content

Hello, Does anybody knows why am I getting a “CA Error The TranDate value of the CADailySummary table is incorrect because it contains a time component. The format must be yyyy-mm-dd” when trying to save an ARPayment record.

My code is:

ARPaymentEntry graphPAY = PXGraph.CreateInstance<ARPaymentEntry>();
ARPayment payment = new ARPayment();
payment.DocType = "PMT";
payment.ExtRefNbr = paymentRecord.tid;
payment.CustomerID = salesOrders.CustomerID;
payment.AdjDate = creationDate;
payment.DocDesc = ihubOrder.storeCode;
payment.CuryOrigDocAmt = paymentRecord.value;
//payment.AdjFinPeriodID = creationDate.ToString("MM-yyyy");
PaymentMethod method = SelectFrom<PaymentMethod>.Where<PaymentMethodExt.usrMarketPlacePaymentMethod.IsEqual<@P.AsString>>.View.Select(graphSO, paymentRecord.group);
if (method != null)
{
payment.PaymentMethodID = method.PaymentMethodID;
}
else
{
payment.PaymentMethodID = "DEFAULT"; //DEFAULT
}


CashAccount cashAcc = SelectFrom<CashAccount>.Where<CashAccount.cashAccountCD.IsEqual<@P.AsString>>.View.Select(graphSO, "BANAMEX001"); // BANAMEX001
if (cashAcc != null)
{
payment.CashAccountID = cashAcc.CashAccountID;
}
graphPAY.Document.Insert(payment);
graphPAY.Actions.PressSave();

I hope somebody could help me. I just can’t fin the light on this issue.

Thanks in advance.

I find that I get CADSummary errors when the BranchID doesn't get set. If you can, I would debug and check, other option is to get it from AccessInfo


Hi @albertobello83  Not sure about the error and have never seen it.

I tried with the below sample code to create the payment and it is working fine for me.

 

Hope this can help you!

ARPaymentEntry graphPAY = PXGraph.CreateInstance<ARPaymentEntry>();
ARPayment payment = new ARPayment();
payment.DocType = "PMT";
payment.ExtRefNbr = "TEST ExtRefNbr";
payment.CustomerID = 7048;
payment.AdjDate = Base.Accessinfo.BusinessDate;
payment.DocDesc = "Test Desc";
payment.CuryOrigDocAmt = 50m;
payment.PaymentMethodID = "CASH";
graphPAY.Document.Insert(payment);
graphPAY.Actions.PressSave();

 

 


You have payment.AdjDate = creationDate, which, I assume, contains the time component. 

It must only contain date, the time must be set to 00:00:00.000 for all Date fields in the ARPayment document


Reply