Updating tally response xml to include masterid of the created ledger

Discussion in 'Tally Integration' started by sriharisivaraj, Mar 19, 2021.

    
  1. sriharisivaraj

    sriharisivaraj New Member


    Below is the simple xml to add masters to tally.

    Request XML

    <ENVELOPE>
    <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>Import</TALLYREQUEST>
    <TYPE>Data</TYPE>
    <ID>All Masters</ID>
    </HEADER>
    <BODY>
    <DESC>
    <STATICVARIABLES>
    <IMPORTDUPS>@@DUPCOMBINE</IMPORTDUPS>
    </STATICVARIABLES>
    </DESC>
    <DATA>
    <TALLYMESSAGE>
    <LEDGER NAME="from dev 1" Action = "Create">
    <NAME>from dev 1</NAME>
    <PARENT>Sundry Debtors</PARENT>
    <OPENINGBALANCE>-12500</OPENINGBALANCE>
    </LEDGER>
    <LEDGER NAME="from dev 2" Action = "Create">
    <NAME>from dev 2</NAME>
    <PARENT>Sundry Debtors</PARENT>
    <OPENINGBALANCE>-1000</OPENINGBALANCE>
    </LEDGER>
    </TALLYMESSAGE>
    </DATA>
    </BODY>
    </ENVELOPE>


    Response XML

    <DATA>
    <IMPORTRESULT>
    <CREATED>2</CREATED>
    <ALTERED>0</ALTERED>
    <DELETED>0</DELETED>
    <LASTVCHID>0</LASTVCHID>
    <LASTMID>0</LASTMID>
    <COMBINED>0</COMBINED>
    <IGNORED>0</IGNORED>
    <ERRORS>0</ERRORS>
    <CANCELLED>0</CANCELLED>
    </IMPORTRESULT>
    </DATA>


    From the above default xml response, we will get to know 2 ledgers got created. Here I would like to know the masterid of the created record.

    From tally documentation, there is a way to alter the response and send back to third party application.
    [​IMG]

    How can I make use of this "Response Report" attribute to include the masterid's or other information like failure messages from tally ?

    Along with above approach, any other suggestions to acheive this ?
     


  2. teja varma

    teja varma Active Member


    Maybe this will help you

    In TallyPrime Developer :

    Goto->Samples->Whats New->Rel 4.x->Rel 4.8->Import Enhancements->Response Report.txt(28):Import File - All Masters
     


  3. sriharisivaraj

    sriharisivaraj New Member


    Thank you for the reference, I have tried using it and was able to get control over the response that I can emit.
    But the required data is available on "After Import Object" which is in a separate tdl file, where I was able to log the masterid's of the imported records.
    which is available in "Goto->Samples->Whats New->Rel 4.x->Rel 4.8->Import Enhancements->ImportOfData.txt(28)"

    any idea on how I can combine these two files and return the xml response with masterid's ?
     


Share This Page