Inconsistent "The transaction date must be today or tomorrow." message
Posted: Mon Jul 24, 2023 9:56 pm
We're seeing inconsistent "The transaction date must be today or tomorrow." messages. When trying to post transfer in/out transactions after hours, some transactions will post successfully, while others get "The transaction date must be today or tomorrow." message. We haven't seen these errors during business hours. Why is the message inconsistent or is it something we're doing wrong?
The account used does not have the "Use any transaction date" permission.
This is the code we use.
The account used does not have the "Use any transaction date" permission.
This is the code we use.
Code: Select all
var newTransaction = transactionsManager.NewTransaction<ILedgerTransferOutTransaction>(ledgerInfo);
newTransaction.Memo = memo;
newTransaction.Amount = amount;
newTransaction.Name = name;
newTransaction.Status = TransactionStatus.Posted;
var ledgerInTransaction = transactionsManager.NewLedgerTransferIn(newTransaction, ledgerInInfo, TransactionStatus.Posted, null);
ledgerInTransaction.Memo = transferInMemo;
ledgerInTransaction.Splits.Where(s => s.Kind == TransactionSplitKind.Applied).FirstOrDefault().Amount = amount;
ledgerInTransaction.Splits.Where(s => s.Kind == TransactionSplitKind.Unapplied).FirstOrDefault().Amount = 0;
ledgerInTransaction.Name = orderNumber;
ledgerInTransaction.Tags.Add(new Tag("OrderContactID", contactId));
ledgerInTransaction.Medium = medium;
transactionsManager.ApplyChanges(null, newTransaction);