tally

How to export employees from tally in XML format?


How to export employees & employee groups from tally in XML format?

<ENVELOPE>
    <HEADER>
        <VERSION>1</VERSION>
        <TALLYREQUEST>Export</TALLYREQUEST>
        <TYPE>Collection</TYPE>
        <ID>CostCenters</ID>
    </HEADER>
    <BODY>
        <DESC>
            <STATICVARIABLES>
                <SVEXPORTFORMAT>SysName:XML</SVEXPORTFORMAT>
            </STATICVARIABLES>
            <TDL>
                <TDLMESSAGE>
                    <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="CostCenters">
                        <TYPE>CostCenter</TYPE>
                        <NATIVEMETHOD>*</NATIVEMETHOD>                        
                        <FILTERS>filter</FILTERS>
                    </COLLECTION>
                    <SYSTEM TYPE="Formulae" NAME="filter">ISEMPLOYEEGROUP="NO"</SYSTEM>
                </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>

But, when I tried without filter, it provides all employees & employee group


Solution

  • Your Filter is wrong you should prefix $ for ISEMPLOYEEGROUP

    <SYSTEM TYPE="Formulae" NAME="filter">$ISEMPLOYEEGROUP="NO"</SYSTEM>
    

    or

    <SYSTEM TYPE="Formulae" NAME="filter">Not $ISEMPLOYEEGROUP</SYSTEM>
    

    to get employee groups above filter works If you want employees add another filter

    <SYSTEM TYPE="Formulae" NAME="IsPayroll">$FORPAYROLL</SYSTEM>