I need to apply customer payments with invoices and I can do that on the general journal when I'm posting the payment, but if the payment date is earlier than the invoice date, that is not possible to apply and post an entry to an entry with an earlier date.
So I'm trying apply the documents after they are already posting, But I'm always getting the message "The application was successfully posted though no entries have been applied." but if In look to the entries both remain open.
thee code That I used was:
CustLedgEntry.GET(1904988); //Payment
ApplyingCustLedgEntry.GET(1905055); //Invoice
CustEntrySetApplID.SetApplId(CustLedgEntry,ApplyingCustLedgEntry,GetAppliesToID);
ApplyingCustLedgEntry.VALIDATE("Amount to Apply", 25);
ApplyingCustLedgEntry.MODIFY;
CustEntryApplyPostedEntries.Apply(ApplyingCustLedgEntry,ApplyingCustLedgEntry."Document No.",ApplyingCustLedgEntry."Posting Date");
Where CustEntrySetApplID is the codeunit Cust. Entry-SetAppl.ID and CustEntryApplyPostedEntries is the codeunit CustEntry-Apply Posted Entries
Any sugestions?
thanks in advanced
So I'm trying apply the documents after they are already posting, But I'm always getting the message "The application was successfully posted though no entries have been applied." but if In look to the entries both remain open.
thee code That I used was:
CustLedgEntry.GET(1904988); //Payment
ApplyingCustLedgEntry.GET(1905055); //Invoice
CustEntrySetApplID.SetApplId(CustLedgEntry,ApplyingCustLedgEntry,GetAppliesToID);
ApplyingCustLedgEntry.VALIDATE("Amount to Apply", 25);
ApplyingCustLedgEntry.MODIFY;
CustEntryApplyPostedEntries.Apply(ApplyingCustLedgEntry,ApplyingCustLedgEntry."Document No.",ApplyingCustLedgEntry."Posting Date");
Where CustEntrySetApplID is the codeunit Cust. Entry-SetAppl.ID and CustEntryApplyPostedEntries is the codeunit CustEntry-Apply Posted Entries
Any sugestions?
thanks in advanced