In this example we will use VBScript to retrieve the list of loaded companies in Tally and display it on a web page. Tally will respond to well formed XML fragments only. Therefore we need to construct a XML string for sending to Tally. We can construct the XML fragment either by using the DOM of the MS XML parser of writing the entire fragment manually. ‘ SOAP request to get list of loaded companies Dim strRequestXML ‘ store request XML Code: strRequestXML = _ "<ENVELOPE>" & _ " <HEADER>" & _ " <TALLYREQUEST>Export Data</TALLYREQUEST>" & _ " </HEADER>" & _ " <BODY>" & _ " <EXPORTDATA>" & _ " <REQUESTDESC>" & _ " <REPORTNAME>List of Companies</REPORTNAME>" & _ " <STATICVARIABLES>" & _ " <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>" & _ " </STATICVARIABLES>" & _ " </REQUESTDESC>" & _ " </EXPORTDATA>" & _ " </BODY>" & _ "</ENVELOPE>" Before sending this request to a remote host, we need to know the IP / domain name and the listening port of Tally. In this example we assume the Tally is running on IP 192.168.1.1, Port 9000. Now,Sending data to Tally requires instantiating the ServerXMLHTTP and using Open and Send methods of the component. Dim ServerObj Set ServerObj = Server.CreateObject ( "Msxml2.ServerXMLHTTP" ) ServerObj.open "POST", "http://192.168.1.1:9000â€Â, FALSE ServerObj.send strRequestXML This above code sends the XML request to Tally. To retrieve Tally’s response we do the following Dim strResponseXML strResponseXML = ServerObj .responseText If there are 2 companies currently loaded in Tally - ABC Company and Test Company then Tally will respond with the following XML fragment. Code: <ENVELOPE> <COMPANYNAME.LIST> <COMPANYNAME>Demo Company</COMPANYNAME> <COMPANYNAME>Tally Solutions</COMPANYNAME> </COMPANYNAME.LIST> </ENVELOPE> You can now parse this XML to display the list of companies.
Query-----> Xml file required to Fetch(export) Ledger Vouchers for a specific Ledger. Actually I'm a java Developer working in Tally Integration in our product "Invoice Tracker" and new to Tally. If anybody has any idea about the "Query" please replay.
you can use ajax for that Code: var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.write( this.responseText); } }; xhttp.open("POST", "http://localhost:9000", true); xhttp.send(xml_data); please check odbc port in tallyerp9 before making request
good sir, it is better to use http://localhost:9000 beacuse ip address is not same at all time there will be some conflicts at runtime it
hi this code returns only companies loaded in tally. is there a options to get all companies. i found a ref in tally site https://help.tallysolutions.com/article/DeveloperReference/faq/8854.html but when i try it tally crashed and got msg that memmory execption how to use this ref as xml request Regards
just run tally and try this xml request you will get all companies in Data base: Code: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>Export</TALLYREQUEST> <TYPE>Collection</TYPE> <ID>Hostcmpondisk</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> </STATICVARIABLES> <TDL> <TDLMESSAGE> <COLLECTION Name='Hostcmpondisk'> <TYPE>Company On Disk</TYPE> <NATIVEMETHOD>Name</NATIVEMETHOD> </COLLECTION> </TDLMESSAGE> </TDL> </DESC> </BODY> </ENVELOPE>
Great! Can you tell me where one can find Collection Names and Types. Is there a list of such ids in Tally site? Thanks
hi can we also get company guid so that in future we can get ledger of that company using <SVCURRENTCOMPANY> tag on next command
so what will be the XML for it actually i have tried collection with xml and got success but how to use functions and variables does not get any success.
its same as you have mentioned above Code: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>Export</TALLYREQUEST> <TYPE>Collection</TYPE> <ID>Hostcmpondisk</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> </STATICVARIABLES> <TDL> <TDLMESSAGE> <COLLECTION Name='Hostcmpondisk'> <TYPE>Company On Disk</TYPE> <NATIVEMETHOD>Name</NATIVEMETHOD> </COLLECTION> </TDLMESSAGE> </TDL> </DESC> </BODY> </ENVELOPE> then to get ledger as you have shown in other thread Code: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>Export</TALLYREQUEST> <TYPE>Data</TYPE> <ID>Hostledgers</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> </STATICVARIABLES> <TDL> <TDLMESSAGE> <REPORT NAME="Hostledgers"> <FORMS>Hostledgers</FORMS> </REPORT> <FORM NAME="Hostledgers"> <TOPPARTS>Hostledgers</TOPPARTS> </FORM> <PART NAME="Hostledgers"> <TOPLINES>Hostledgers</TOPLINES> <REPEAT>Hostledgers:Hostledcoll</REPEAT> <SCROLLED>Vertical</SCROLLED> </PART> <LINE NAME="Hostledgers"> <LEFTFIELDS>ledname</LEFTFIELDS> </LINE> <FIELD NAME="ledname"> <SET>$Name</SET> </FIELD> <COLLECTION NAME="Hostledcoll" > <TYPE>Ledgers</TYPE> <FILTERS>isreqledger</FILTERS> </COLLECTION> <SYSTEM TYPE="Formulae" NAME="isreqledger">$Name:Ledger:$Name contains ""</SYSTEM> </TDLMESSAGE> </TDL> </DESC> </BODY> </ENVELOPE>
the problem is that we cant get guid without the company is opened so the company should be opened in order to get guid
compute method for guid: Code: <ENVELOPE> <HEADER> <VERSION>1</VERSION> <TALLYREQUEST>Export</TALLYREQUEST> <TYPE>Collection</TYPE> <ID>Hostcmpondisk</ID> </HEADER> <BODY> <DESC> <STATICVARIABLES> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> </STATICVARIABLES> <TDL> <TDLMESSAGE> <COLLECTION Name='Hostcmpondisk'> <TYPE>Company On Disk</TYPE> <NATIVEMETHOD>Name</NATIVEMETHOD> <COMPUTE>Guid:$Guid:Company:$Name</COMPUTE> </COLLECTION> </TDLMESSAGE> </TDL> </DESC> </BODY> </ENVELOPE> you will only get the guid's of companies that are currently opened in tally
1)you can get ledgers by mentioning company name in the SVCURRENTCOMPANY tag not guid or 2) use guid-> company name resolution process its very simple.. -> first get the guid of the active company ->find the company name from your database with the guid that you got (assuming you stored all the companies and their guid's) ->use that company name to get the ledgers and whatever you want..
Thanks for sharing this, but is their any way to get the name of selected company on which user is currently working.