C/AL Routine to Apply Entries
Ewan
Member Posts: 54
Hi
Does anyone out there know of or has created a C/AL routine that can be used to apply ledger entries?
Does anyone out there know of or has created a C/AL routine that can be used to apply ledger entries?
0
Answers
-
He Ewan,
yes. What kind of ledger entries do you want to apply?
with best regards
Jens0 -
Hi
I would like to create a routine that writes off historic small balances on the customer ledger.
So my approach would be to import and post a set of sales journals to counter the balances.
Next to create a report that when run applies the entries to each other on a 1 to 1 basis
Kind regards
Ewan0 -
Ewan wrote:Hi
I would like to create a routine that writes off historic small balances on the customer ledger.
So my approach would be to import and post a set of sales journals to counter the balances.
Next to create a report that when run applies the entries to each other on a 1 to 1 basis
I have implemented functionality to manual write-off remaining amounts, caused multiply currencies in appled entreis.
There are one form with two functions:
SetEntry(VAR lCLE : Record "Cust. Ledger Entry")
GET(lCLE."Entry No.");
SETRECFILTER;
CALCFIELDS(Amount, "Remaining Amount");
IF Amount="Remaining Amount" THEN ERROR('Entry hasn't applied!');
IF "Currency Code"='' THEN Currency.FIND('-')
ELSE Currency.GET("Currency Code");
IF Positive THEN BalanceAccountNo:=Currency."Realized Losses Acc."
ELSE BalanceAccountNo:=Currency."Realized Gains Acc.";
PostingDate:=lCLE."Posting Date"
PostBalance()
WITH GenJnlLine DO BEGIN
INIT;
"Document No.":=Rec."Document No.";
"Account Type" := "Account Type"::Customer;
VALIDATE("Account No.", Rec."Customer No.");
"Posting Date":=PostingDate;
Description := 'balance entry';
"Bal. Account Type" := "Bal. Account Type"::"G/L Account";
VALIDATE("Bal. Account No.",BalanceAccountNo);
VALIDATE("Currency Code", Rec."Currency Code");
IF Rec.Positive THEN BEGIN
VALIDATE(Amount, -Rec."Remaining Amount");
VALIDATE("Amount (LCY)",-Rec."Remaining Amt. (LCY)");
END
ELSE BEGIN
VALIDATE(Amount, -Rec."Remaining Amount");
VALIDATE("Amount (LCY)", -Rec."Remaining Amt. (LCY)");
END;
"Applies-to Doc. Type":=Rec."Document Type";
"Applies-to Doc. No.":=Rec."Document No.";
Description:=Desc;
"Shortcut Dimension 1 Code":=Rec."Global Dimension 1 Code";
"Shortcut Dimension 2 Code":=Rec."Global Dimension 2 Code";
tempJnlLineDim.RESET;
tempJnlLineDim.DELETEALL;
LedgerEntryDim.SETRANGE("Table ID", DATABASE::"Cust. Ledger Entry");
LedgerEntryDim.SETRANGE("Entry No.", Rec."Entry No.");
DimMgt.CopyLedgEntryDimToJnlLineDim(LedgerEntryDim, tempJnlLineDim);
GenJnlPostLine.RunWithCheck(GenJnlLine,tempJnlLineDim);
CurrForm.CLOSE;
END;Looking for part-time work.
Nav, T-SQL.0 -
Thank you for your help
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions