XML Request to get partynames & gstin number

Discussion in 'Tally Integration' started by rajeshca911, Aug 24, 2022.

    
  1. rajeshca911

    rajeshca911 New Member


    Please help me to get party name and gstin number either creditors or debtors from tally through xml http request
     


  2. Sai Vineeth

    Sai Vineeth Active Member


    Code:
    <ENVELOPE>
        <HEADER>
            <VERSION>1</VERSION>
            <TALLYREQUEST>EXPORT</TALLYREQUEST>
            <TYPE>DATA</TYPE>
            <ID>LISTOFLEDGER</ID>
        </HEADER>
        <BODY>
            <DESC>
                <TDL>
                    <TDLMESSAGE>
                        <REPORT ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="LISTOFLEDGER">
                            <FORMS>LISTOFLEDGER</FORMS>
                        </REPORT>
                        <FORM ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="LISTOFLEDGER">
                            <TOPPARTS>LISTOFLEDGER</TOPPARTS>
                            <XMLTAG>LISTOFLEDGER</XMLTAG>
                        </FORM>
                        <PART ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="LISTOFLEDGER">
                            <TOPLINES>LISTOFLEDGER</TOPLINES>
                            <REPEAT>LISTOFLEDGER : CUSTOM_LEDGERCOLL</REPEAT>
                            <SCROLLED>Vertical</SCROLLED>
                        </PART>
                        <LINE ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="LISTOFLEDGER">
                            <FIELDS>NAME,GSTIN</FIELDS>
                            <XMLTAG>LEDGER</XMLTAG>
                        </LINE>
                        <FIELD ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="NAME">
                            <SET>$NAME</SET>
                            <XMLTAG>NAME</XMLTAG>
                        </FIELD>
                        <FIELD ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="GSTIN">
                            <SET>$PARTYGSTIN</SET>
                            <XMLTAG>GSTIN</XMLTAG>
                        </FIELD>
                        <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="CUSTOM_LEDGERCOLL">
                            <TYPE>LEDGER</TYPE>
                            <NATIVEMETHOD>Name,PARTYGSTIN</NATIVEMETHOD>
                        </COLLECTION>
                    </TDLMESSAGE>
                </TDL>
            </DESC>
        </BODY>
    </ENVELOPE>
     
    rajeshca911 likes this.


  3. rajeshca911

    rajeshca911 New Member


    "I'm experiencing an issue with the code mentioned above in Tally Prime version 3.0. It seems that the code is not able to fetch GSTINs. If it's possible, could someone kindly assist me in updating the code? Your help would be greatly appreciated. Thank you in advance.
     


  4. Sai Vineeth

    Sai Vineeth Active Member


    Use
    $LedGSTRegDetails[last].GSTIN instead of
    $PARTYGSTIN in Tally Prime 3.0
     
    Last edited: Jul 21, 2023
    rajeshca911 likes this.


  5. rajeshca911

    rajeshca911 New Member


    Thanks a lot for your help Sai
     
    Sai Vineeth likes this.


  6. Sridharan S

    Sridharan S Member


    Looks like working in Prime 3 too.
    ParyGSTIN works as long as it is within Collection
     


  7. Sai Vineeth

    Sai Vineeth Active Member


    This works in Tally prime 3.0, if and only ledger is created in old version of Tally,
    If ledger is created in new version its using LedGSTRegDetails , so it's better to use $LedGSTRegDetails[last].GSTIN to support all clients.
     


  8. Sai Vineeth

    Sai Vineeth Active Member


    use $LedGSTRegDetails[last].GSTIN to get latest details.
    there's a chance that client may have different taxability during period, last will fetch the latest GSTIN.
     


  9. Sridharan S

    Sridharan S Member


    Yes Collections can hold multiple objects. So preferable.
     
    Last edited: Jul 23, 2023


  10. sattam

    sattam Active Member


    I want to filter it under group debtors and creditors and not empty $LedGSTRegDetails[last].GSTIN
     


  11. Sai Vineeth

    Sai Vineeth Active Member


    you can childof inside collection and mention name of group you want to filter.
    if you want nested childs then add <Belongsto>Yes</Belongsto> also
    Code:
    <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="CUSTOM_LEDGERCOLL">
           <TYPE>LEDGER</TYPE>
    <CHILDOF>SundryDebtors</CHILDOF>
    <Belongsto>Yes</Belongsto>
         <NATIVEMETHOD>Name,LedGSTRegDetails.*</NATIVEMETHOD>
    </COLLECTION>
    
    To filter out empty you can add filter to collection
    Code:
    </TDLMESSAGE>
    
    <COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="CUSTOM_LEDGERCOLL">
           <TYPE>LEDGER</TYPE>
    <CHILDOF>SundryDebtors</CHILDOF>
    <Belongsto>Yes</Belongsto>
         <NATIVEMETHOD>Name,LedGSTRegDetails.*</NATIVEMETHOD>
    <FILTERS> ISContainsGST</FILTERS>
    </COLLECTION>
    <SYSTEM TYPE="Formulae" NAME="ISContainsGST">NOT $$ISEMPTY:$LedGSTRegDetails[last].GSTIN</SYSTEM>
    
    </TDLMESSAGE>
    
    
     
    Last edited: Oct 6, 2023


  12. sattam

    sattam Active Member


    Thanks it works
     
    Sai Vineeth likes this.


  13. Sridharan S

    Sridharan S Member


    LedGSTRegDetails collection works with newer version of Tally, old or new data
     


Share This Page