How to retrieve Master id for the imported ledgers

Discussion in 'Tally Integration' started by sriharisivaraj, Jul 18, 2018.

    
  1. sriharisivaraj

    sriharisivaraj New Member


    I'm able to add legders to tally using the following xml,
    In response xml, we can see how many records are created, but how can we get the masterid's in the response xml

    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>
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    MasterID, GUID, AlterID, VoucherKey are created by Tally.......
     


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    It will be created/assigned by Tally after the import.....so it will not appear in your Response XML....

    However if you assign MasterID in your Excel database (from where you have imported) then tally will take that assigned value.
     
    sriharisivaraj likes this.


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    e.g. see the excel file database I made for a client and wherein I have input the Voucher Key and GUID......

    111Capture.PNG 222Capture.PNG
     


  5. sriharisivaraj

    sriharisivaraj New Member


    Hi Amit,

    Thank you for the information.
    I tried setting both masterid and guid while sending legder xml, but no luck.
    here is my request :

    <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="xml ledger" Action = "Create">
    <NAME>xml ledger</NAME>
    <PARENT>Sundry Debtors</PARENT>
    <OPENINGBALANCE>5000</OPENINGBALANCE>
    <MASTERID>24459</MASTERID>
    <GUID>1b040450-a194-4f40-a3c5-c581edc98dcb-00000889</GUID>

    </LEDGER>
    </TALLYMESSAGE>
    </DATA>
    </BODY>
    </ENVELOPE>

    I did a separate request to retrieve the created record, it didn't created the record with the masterid and guid that I provided in request

    Here is the response


    <LEDGERS>
    <VMASTERID>216</VMASTERID>
    <VGUID>1b040450-a194-4f40-a3c5-c581edc98dcb-000000d8</VGUID>

    <VLEDGERNAME>xml ledger</VLEDGERNAME>
    <VSTATE></VSTATE>
    <VADDRESS>999</VADDRESS>
    <VPINCODE></VPINCODE>
    <VPHONE></VPHONE>
    <VMOBILE></VMOBILE>
    <VFAX></VFAX>
    <VEMAIL></VEMAIL>
    <VEMAIL1></VEMAIL1>
    <VALTEREDON>23-Jul-2018</VALTEREDON>
    <VALTEREDONDT>23-Jul-2018 2:55 PM</VALTEREDONDT>
    <VNOTES></VNOTES>
    </LEDGERS>

    Is there any configuration in tally, that I need to change if I have to overwrite default masterid numbering ?
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Nothing you can do...as these IDs are internal and work on some alogrithm by the Tally.exe

    Let me know what this response is....is it your own made? coz All your codes are prefixed by letter "V".............
     


  7. sriharisivaraj

    sriharisivaraj New Member


    Hi Amit,

    That is custom made response where I'm prefixing 'V', which is requesting Masterid and GUID.
    The response that I have posted earlier is the complete response.
    modified request format :
    <FIELD NAME="VMasterID">
    <USE>Name Field</USE>
    <SET>$MasterId</SET>
    </FIELD>
    <FIELD NAME="VGUID">
    <USE>Name Field</USE>
    <SET>$GUID</SET>
    </FIELD>

    If we can't get the id's back, how are we supposed to update those particular records from other applications ?
    Don't we need master id or GUID for updating an existing ledger or stockitem in tally?

    Let me know, if there is any other way to handle this case ?
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    k...actually u dont need masterID or GUID...tally will take care of it internally when u import data

    explain to me what exactly r u trying to achieve by the response XML....
     


  9. sriharisivaraj

    sriharisivaraj New Member


    Hi Amit,

    Thank you for the information.
    Here I need masterid in the response, to update the same ledger from the Third Party App(TPA) to tally.
    Lets say we have created a ledger "ABC" from TPA to tally, next time "ABC" got updated as "XYZ" in the TPA.
    Now from the TPA we should update the record ABC to XYZ in tally, for sending this import request,
    I wanted to update the existing ledger "ABC" in tally using the masterid.

    Getting the masterid by retrieving the ledger, before performing update operation is one approach.

    Is there any other approach ?

    Thankyou
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    this will be the only one....which tells tally from the commom MasterID that ABC and XYZ is same and hence replace ABC with XYZ
     


  11. Jyotirmaya

    Jyotirmaya New Member



    Hi Sir,
    For this problem any solution you find or not ? if you got any solution, then please share with me.
     


Share This Page