Ledger Information based on Company name

Discussion in 'Tally Integration' started by Researcher, Apr 10, 2021.

    
  1. Researcher

    Researcher New Member


    I am using Tally ERP9.

    Below xml request is used to get the ledger information
    Code:
    <ENVELOPE><HEADER><VERSION>1</VERSION><TALLYREQUEST>Export</TALLYREQUEST><TYPE>Collection</TYPE><ID>TestLedgerList2</ID><STATICVARIABLES></STATICVARIABLES></HEADER><BODY><DESC><TDL><TDLMESSAGE><COLLECTION NAME='TestLedgerList2' ISMODIFY='NO'><TYPE>Ledger</TYPE ><FETCH>Name,OpeningBalance, ClosingBalance IsRevenue, IsDeemedPositive, Parent,IsSubLedger,AffectsGrossProfit</FETCH></COLLECTION></TDLMESSAGE></TDL></DESC></BODY></ENVELOPE>
    How to modify the above xml request to get the ledger information based on company name?
     


  2. teja varma

    teja varma Active Member


    add this tag <SVCURRENTCOMPANY>CompanyNameAsInTally</SVCURRENTCOMPANY> inside static variables
    you will get data for that company else an error if the company not opened.
     


  3. Researcher

    Researcher New Member


    I have opened 2 company in the tally and used the below xml request to get the ledger information.
    But i am getting same result for both Comapny1 and company2.

    Code:
    <ENVELOPE><HEADER><VERSION>1</VERSION><TALLYREQUEST>Export</TALLYREQUEST><TYPE>Collection</TYPE><ID>TestLedgerList2</ID><STATICVARIABLES><SVCURRENTCOMPANY>Company_name</SVCURRENTCOMPANY></STATICVARIABLES></HEADER><BODY><DESC><TDL><TDLMESSAGE><COLLECTION NAME='TestLedgerList2' ISMODIFY='NO'><TYPE>Ledger</TYPE ><FETCH>Name,OpeningBalance, ClosingBalance IsRevenue, IsDeemedPositive, Parent,IsSubLedger,AffectsGrossProfit</FETCH></COLLECTION></TDLMESSAGE></TDL></DESC></BODY></ENVELOPE>
    How to get the result based on the company name?
     
    Last edited: Apr 12, 2021


  4. Researcher

    Researcher New Member


    Changing Xml request to below worked for me.
    Code:
    <ENVELOPE><HEADER><VERSION>1</VERSION><TALLYREQUEST>Export</TALLYREQUEST><TYPE>Collection</TYPE><ID>TestLedgerList2</ID></HEADER><BODY><DESC><STATICVARIABLES><SVCURRENTCOMPANY>Company_name</SVCURRENTCOMPANY></STATICVARIABLES><TDL><TDLMESSAGE><COLLECTION NAME='TestLedgerList2' ISMODIFY='NO'><TYPE>Ledger</TYPE ><FETCH>Name,OpeningBalance, ClosingBalance IsRevenue, IsDeemedPositive, Parent,IsSubLedger,AffectsGrossProfit</FETCH></COLLECTION></TDLMESSAGE></TDL></DESC></BODY></ENVELOPE>
     


Share This Page