Apply Customer entries by code
nuno.silva
Member Posts: 29
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
===============
Nuno Silva
Nuno Silva
0
Best Answer
-
That's a feature, not a bug. Or so... You can't have detailed ledger entries with a date before the posting date of the initial entry, that's the main issue here. So, an application date before the posting date of your invoice is not allowed. Since the application date can only be set in applications on existing entries, you're a little stuck. You would need to change the posting logic to accept an explicit application date (extra field), or to use the posting date of the invoice instead. The handling was less strict in NAV versions before 2009.
with best regards
Jens5
Answers
-
That's a feature, not a bug. Or so... You can't have detailed ledger entries with a date before the posting date of the initial entry, that's the main issue here. So, an application date before the posting date of your invoice is not allowed. Since the application date can only be set in applications on existing entries, you're a little stuck. You would need to change the posting logic to accept an explicit application date (extra field), or to use the posting date of the invoice instead. The handling was less strict in NAV versions before 2009.
with best regards
Jens5 -
I took your words and create a field in the journal with the apply date and on the function where I get the error, ValidateApplyRequirements, I made an IF the apply date <> 0D compare with that apply date else compare with the journal posting date.
After that I make a quick test posting and apply a document and every records look OK, he use in all applications the date of the invoice.
thanks for the idea===============
Nuno Silva0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions