Search code examples
tally

How to export group from tally in XML format?


How to export group from tally in XML format?

 <ENVELOPE>

        <HEADER>
            <VERSION>1</VERSION>
            <TALLYREQUEST>Export</TALLYREQUEST>
            <TYPE>Collection</TYPE>
            <ID>Groups</ID>
        </HEADER>
        <BODY>
            <DESC>
                <STATICVARIABLES>
                    <SVEXPORTFORMAT>SysName:XML</SVEXPORTFORMAT>
                    <SVCURRENTCOMPANY>TEST COMPANY</SVCURRENTCOMPANY>
                </STATICVARIABLES>
                <TDL>
                    <TDLMESSAGE>
                        <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="Ledgers">
                            <TYPE>Group</TYPE>
                            <NATIVEMETHOD>*</NATIVEMETHOD>
                        </COLLECTION>
                    </TDLMESSAGE>
                </TDL>
            </DESC>
        </BODY>             
    </ENVELOPE>

I tried by using above mentioned code. But its response looks like below:

<DATA><COLLECTION ISMSTDEPTYPE="Yes" MSTDEPTYPE="4">   </COLLECTION></DATA>

Solution

  • Your collection Name is wrong

    <ID>Groups</ID>
    

    should match with collection Name you are sending in TDLMESSAGE else that collection should exist in Tally

    Since You are creating custom collection ,It must match with collection name in TDLMESSAGE

    Change From

    <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="Ledgers">
    

    To

    <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="Groups">