Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Customize Ledger Journal

(1) ShareShare
ReportReport
Posted on by 39
So I am trying to add some custom fields to Ledger Journal DP and I am using COC to do this as this code showing:
 
in this case the original fields gets added but my custom test fields doesn't gets added, any solutions or ideas?
[ExtensionOf(classStr(LedgerJournalDP))]
internal final class LedgerJournalDP_Extension
{
    protected void insertTransactionsFromLedgerJournalTrans()
    {
        next insertTransactionsFromLedgerJournalTrans();

        ledgerJournalTmp.CurrencyCode = 'USD';
        ledgerJournalTmp.JournalName = 'Pay';
        ledgerJournalTmp.Company = 'ttr';
        ledgerJournalTmp.JournalNum = 'TTR-000001';
        ledgerJournalTmp.TotalAmountSumDebit = 1337000;

        ledgerJournalTmp.insert();
        
    }

}
 
Categories:
  • Kareem Profile Picture
    Kareem 39 on at
    Customize Ledger Journal
    Okay so basically I am trying to make a copy of "Posted transactions by journal" report, literally the same data, same structure and everything but I need it to work for the not posted transactions.
     
    So I was trying to extend the first report "Journal" and try to add to it the other needed data so it be like "Posted transactions by journal" report.
     
    in other words I need to make "Posted transactions by journal" report version that works for unposted transactions too.
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,458 Most Valuable Professional on at
    Customize Ledger Journal
    Okay, so please start by explaining what you're trying to achieve, because now you're saying something else then before.
     
    Then explain your problem to us. Just saying that it doesn't work isn't sufficient, because that can mean anything. Also, tell us what you've found when you debugged your code.
  • Kareem Profile Picture
    Kareem 39 on at
    Customize Ledger Journal
    I am trying to make a report looks like 'Ledger Journal' report but with additional custom rows and I tried many approaches to do this but nothing is working with me.
     
    I will really appreciate if anyone can give me a guide or a way to do it.
     
    Thanks in advance.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,458 Most Valuable Professional on at
    Customize Ledger Journal
    Your code is trying to duplicate all lines by calling another insert() (while the records are also inserted by standard code). You mentioned no such a requirement, therefore it seems to be a bug that you failed to notice when you debugged your code.
     
    You can't extend insert_recordset statement in the standard code, therefore you'll need to update the records afterwards (either with update_recordset or by using a while select and update()).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans