private void button10_Click(object sender, EventArgs e)
{
string tallyXml = @"<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>All Masters</REPORTNAME>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF='TallyUDF'>
<COSTCENTRE NAME='Accenture/001/24-255' RESERVEDNAME=''>
<NAME>Accenture/001/24-255</NAME>
<PARENT></PARENT>
<CATEGORY>MUM-UNBILLED(LIVE JOBS)</CATEGORY>
<UDF:EICREATEDBY>Mustafa</UDF:EICREATEDBY>
<UDF:EICREATEDON>20250301</UDF:EICREATEDON>
<UDF:QSMSTJOBPARTY>GLANBIA STOCKS AND EXPENSES</UDF:QSMSTJOBPARTY>
<UDF:QSJOBTYPE>Sea</UDF:QSJOBTYPE>
<UDF:QSJOBCATEGORY>Test Cateory</UDF:QSJOBCATEGORY>
<UDF:QSJOBSUBCATEGORY>Test Sub Category</UDF:QSJOBSUBCATEGORY>
<UDF:QSPORTOFORIGIN>Dubai Port</UDF:QSPORTOFORIGIN>
<UDF:QSPORTOFLOAD>Nhava Sheva</UDF:QSPORTOFLOAD>
<UDF:QSINVNO>INV1234</UDF:QSINVNO>
<UDF:QSINVDATE>20250301</UDF:QSINVDATE>
<UDF:QSEIITEMS>Test Product XML Parsing</UDF:QSEIITEMS>
<UDF:QSBENUMBER>BE12345</UDF:QSBENUMBER>
<UDF:QSBEDATE>20250301</UDF:QSBEDATE>
<UDF:QSAWBNO>BL98723</UDF:QSAWBNO>
<UDF:QSAWBDATE>20250302</UDF:QSAWBDATE>
<UDF:QSHOUSEAWBNO1>MAWB12345</UDF:QSHOUSEAWBNO1>
<UDF:QSHOUSEAWBDATE1>20250303</UDF:QSHOUSEAWBDATE1>
<UDF:QSVESSELNO>V929332</UDF:QSVESSELNO>
<UDF:QSGROSSWT>100</UDF:QSGROSSWT>
<UDF:QSGROSSWTUNIT>KGS</UDF:QSGROSSWTUNIT>
<UDF:QSNETWT>99</UDF:QSNETWT>
<UDF:QSNETWTUNIT>KGS</UDF:QSNETWTUNIT>
<UDF:QSNOOFPKG>10</UDF:QSNOOFPKG>
<UDF:QSNOOFPKGUNIT>PKGS</UDF:QSNOOFPKGUNIT>
<UDF:QSHOUSEAWBNO>HBL19282</UDF:QSHOUSEAWBNO>
<UDF:QSHOUSEAWBDATE>20250305</UDF:QSHOUSEAWBDATE>
<UDF:QSROTATIONNO>RO9282</UDF:QSROTATIONNO>
<UDF:QSROTATIONDATE>20250306</UDF:QSROTATIONDATE>
<UDF:QSIGMNO>IGM837282</UDF:QSIGMNO>
<UDF:QSIGMDATE>20250307</UDF:QSIGMDATE>
<UDF:QSPONO>PO9823</UDF:QSPONO>
<UDF:QSPODATE>20250308</UDF:QSPODATE>
<UDF:QSVOYAGE>VOY83728</UDF:QSVOYAGE>
<UDF:QSASSESSABLE>384828782.00</UDF:QSASSESSABLE>
<UDF:QSDOCDATE>20250228</UDF:QSDOCDATE>
<UDF:QSBILLTYPE>Sea</UDF:QSBILLTYPE>
<UDF:PDBYPARTY>1000</UDF:PDBYPARTY>
<UDF:QSCONTAINERDESC>2000x20000FCL</UDF:QSCONTAINERDESC>
<UDF:QSREMARK>Remark</UDF:QSREMARK>
<UDF:EIBETYPE>Ex-Bond</UDF:EIBETYPE>
<UDF:EIBONDTYPE>FCL</UDF:EIBONDTYPE>
<UDF:BASICDELDATE>20250310</UDF:BASICDELDATE>
<UDF:BASICFILEDATE>20250228</UDF:BASICFILEDATE>
<UDF:BASICREMARKS>Remarks2</UDF:BASICREMARKS>
<UDF:QSFOBNO>FOB87282</UDF:QSFOBNO>
UDF:QSMSTJOBDATE [blocked]20250301</UDF:QSMSTJOBDATE> UDF:QSENTVALUEFLD1 [blocked]Bondno2342</UDF:QSENTVALUEFLD1> UDF:QSENTVALUEFLD2 [blocked]MUMBAI TRAVEL RETAIL PRIVATE LIMITED</UDF:QSENTVALUEFLD2> UDF:QSENTVALUEFLD3 [blocked]Joel Supplier</UDF:QSENTVALUEFLD3> UDF:QSENTVALUEFLD4 [blocked]FCL</UDF:QSENTVALUEFLD4> UDF:QSENTVALUEFLD5 [blocked]FCL</UDF:QSENTVALUEFLD5> UDF:QSENTVALUEFLD6 [blocked]Some Value 6</UDF:QSENTVALUEFLD6> UDF:QSENTVALUEFLD7 [blocked]Some Value 7</UDF:QSENTVALUEFLD7> UDF:QSENTVALUEFLD8 [blocked]Some Value 8</UDF:QSENTVALUEFLD8> UDF:QSENTVALUEFLD9 [blocked]Some Value 9</UDF:QSENTVALUEFLD9> UDF:QSENTVALUEFLD10 [blocked]Some Value 10</UDF:QSENTVALUEFLD10>
UDF:CONTAINERAGGREGATE.LIST [blocked] UDF:CONTAINERSRNO.LIST [blocked]UDF:CONTAINERSRNO [blocked]1</UDF:CONTAINERSRNO></UDF:CONTAINERSRNO.LIST> UDF:CONTPACKAGE.LIST [blocked]UDF:CONTPACKAGE [blocked]233</UDF:CONTPACKAGE></UDF:CONTPACKAGE.LIST> UDF:CONTGROSS.LIST [blocked]UDF:CONTGROSS [blocked]18883</UDF:CONTGROSS></UDF:CONTGROSS.LIST> UDF:CONTCUBICMTS.LIST [blocked]UDF:CONTCUBICMTS [blocked]22</UDF:CONTCUBICMTS></UDF:CONTCUBICMTS.LIST> UDF:CONTSEALNO.LIST [blocked]UDF:CONTSEALNO [blocked]1213314124</UDF:CONTSEALNO></UDF:CONTSEALNO.LIST> UDF:CONTAINERNO.LIST [blocked]UDF:CONTAINERNO [blocked]2847397292</UDF:CONTAINERNO></UDF:CONTAINERNO.LIST> UDF:SIZE.LIST [blocked]UDF:SIZE [blocked]20</UDF:SIZE></UDF:SIZE.LIST> UDF:CONTAINERTYPE.LIST [blocked]UDF:CONTAINERTYPE [blocked]XYZ_type</UDF:CONTAINERTYPE></UDF:CONTAINERTYPE.LIST> </UDF:CONTAINERAGGREGATE.LIST>
</COSTCENTRE> </TALLYMESSAGE> </REQUESTDATA> </IMPORTDATA> </BODY> </ENVELOPE>"; try
{
string url = "http://localhost:9000"; // Tally listens on port 9800
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/xml";
byte[] byteArray = Encoding.UTF8.GetBytes(tallyXml);
request.ContentLength = byteArray.Length;
using (Stream dataStream = request.GetRequestStream())
{
dataStream.Write(byteArray, 0, byteArray.Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
string responseText = reader.ReadToEnd();
MessageBox.Show("Response from Tally:\n" + responseText, "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show($"Error: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//MessageBox.Show("Tally XML: " + tallyXml.Substring(0, 500), "Debug Info");
//string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "TallyDebug.xml");
// Save XML to file
//File.WriteAllText(filePath, tallyXml);
// Show a message with the file location
//MessageBox.Show("XML file saved at:\n" + filePath, "Download Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
// Open the file location in Explorer
//Process.Start("explorer.exe", Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
i want to implement the api flow and fields data should be filled and get
now what i want is a desktop app on which it will ask the tally port which to connect and the tally listed company and it will follow the auto sync option it will transfer the data to the tally when the
provide me proper folder structure and code file by file
I'll create a complete Windows Forms application that connects to Tally ERP, allows selecting the port and company, and implements auto-sync functionality.
This Next.js application provides a user-friendly interface for integrating with Tally ERP. Here's how it works:
Data Entry: The application provides a comprehensive form to enter cost center data with all the fields from your XML structure, including:
The application is built with:
The code is organized into:
Components: Reusable UI components
tally-data-form.tsx
: Form for entering cost center dataconnection-settings.tsx
: Settings for Tally connectionsync-history.tsx
: History of sync operationsLibrary: Utility functions and services
tally-service.ts
: Service for interacting with Tally ERPutils.ts
: Utility functions for formatting, validation, etc.To deploy this application: