web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

how to post TDS entry while posting a financial journal using x++

(4) ShareShare
ReportReport
Posted on by 70
Hi,
I have two scenarios where I am posting a financial journal using x++,
process is like this : creating header, then lines and posting is not happening immediately. user will be doing posting in separate process later. so user can see tds before and after posting.
these two journal posting happening from separate forms and independent of each other, now in first process, tds entry is being created and i am able to calculate tds before and after posting as well. but in 2nd journal posting tds is not showing before and after posting as well. 
same accounts is being used in both process for debit and credit. is their any reason why tds is not there in 2nd case?
Also, customer requirement is to post tds for 2nd case and we should be able to calculate before and after posting, how can we do that with x++.
Also, in createLedgerJournalLine method, we are doing journal line, transtaxinformation and LedgerJournalTransTaxExtensionIN insertion. 
 
first while receive process (1st case), the code looks like this: 
this.createLedgerJournalTable(journlaName);
creditLedgerDimension = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber('vendoraccount',LedgerJournalACType::Vend);
this.createLedgerJournalLine(PostingDateLoc, voucher, LedgerJournalACType::Vend, creditLedgerDimension, dimensionDefault,
                            -(Amt), invid, NoYes::Yes, 0, 0, inventLocationLogisticsLocation.Location, logisticsLocation.RecId, NoYes::No, txt, '',
                            dateNull(), tdsRequired, invoiceDate, tdsgroup, 0);
debitLedgerDimension  = LedgerDimensionFacade::serviceCreateLedgerDimension(LedgerDimension,DimensionDefault);
this.createLedgerJournalLine(PostingDateLoc, voucher, LedgerJournalACType::Ledger, debitLedgerDimension, DimensionDefault,
    Amt, ' ', NoYes::Yes, 0, HSNCodeTable_IN, inventLocationLogisticsLocation.Location, logisticsLocation.RecId, NoYes::No, txt, '',
    dateNull(), tdsRequired, dateNull(),tdsgroup, 0, TaxRateType);
now the other scenario (2nd case) is just reversed from above process - which is return process:
debitLedgerDimension = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber(VendAccount,LedgerJournalACType::Vend);
creditLedgerDimension = LedgerDimensionFacade::serviceCreateLedgerDimension(LedgerDimension,DimensionDefault);
                
this.createLedgerJournalLine(PostingDateLoc,voucher,LedgerJournalACType::Ledger,creditLedgerDimension,DimensionDefault,
   -(Amt),InvId,NoYes::Yes,sacCode,0,inventLocationLogisticsLocation.Location,logisticsLocation.RecId,
    NoYes::No,journalDescription,'',dateNull(),NoYes::Yes,InvoiceDate,'',0,taxRateType);

this.createLedgerJournalLine(PostingDateLoc,voucher,LedgerJournalACType::Vend,debitLedgerDimension,DimensionDefault,
    Amt,invoiceId,NoYes::Yes,0,0,inventLocationLogisticsLocation.Location,logisticsLocation.RecId,NoYes::No,journalDescription,'',dateNull(),NoYes::Yes,invoiceadate,'',0,taxRateType);
With regards,
Rahul
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at
    Hi Rahul,

    Can you explain the abbreviation TDS? Is this related to Sales Tax in India? Can you explain more about the process? Why do you have two journals with lines?
    We don't know exactly what class you are using and what the methods this.createLedgerJournalTable and this.createLegderJournalLines are doing exactly and where/how you get values for all variables. It is hard to understand what exactly you try to ask on this forum.
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans