Create and Alter Employees Data in Tally 9 using Web Services

Web Services has changed the way we share data across applications. Tally 9 has provided a way to import or export data between applications using the WebService interface which is be default running on port 9000. This can be accessed using http://localhost:9000. You can change the port no from the Advance settings in the Tally Interface.

I would like to share a quick tip for developers who are looking a way to Import Employee data to Tally programmatically using the Tally Web Services. You can use any programming language to consume the service. (C#,NodeJS,PHP). Here i will share just the XML Template which can be used to send the request to Tally.

I recommend to play with this XML using Fiddler to understand better and then start working on the code to send the request to the Tally Service.

fiddler-emp_request

Create Employee Request from Fiddler. (Note the HTTP Method should be POST)

 

emp-response

Response received from Tally

 

1.Get List of All Employees

<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>Collection</TYPE>
<ID>List of All Employees</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>

2.Create or Alter an Employee record. Note COSTCENTRE NAME is the key understood by Tally when altering an employee record .

<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>All Masters</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>TestNK</SVCURRENTCOMPANY>

</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF=”TallyUDF”>
<COSTCENTRE NAME=”Nirmal Kumar” RESERVEDNAME=””   >
<ADDRESS.LIST TYPE=”String”>
<ADDRESS>Bangalore111</ADDRESS>
</ADDRESS.LIST>
<MAILINGNAME.LIST TYPE=”String”>
<MAILINGNAME>10</MAILINGNAME>
</MAILINGNAME.LIST>
<CATEGORY>Primary Cost Category</CATEGORY>
<LOCATION>Bangalorean1</LOCATION>
<DESIGNATION>Software Engineer</DESIGNATION>
<BLOODGROUP>B Positive</BLOODGROUP>
<AFFECTSSTOCK>No</AFFECTSSTOCK>
<FORPAYROLL>Yes</FORPAYROLL>
<FORJOBCOSTING>No</FORJOBCOSTING>
<ISEMPLOYEEGROUP>No</ISEMPLOYEEGROUP>
<SORTPOSITION> 1000</SORTPOSITION>
<DEFAULTLANGUAGE>0</DEFAULTLANGUAGE>
<LANGUAGENAME.LIST>
<NAME.LIST TYPE=”String”>
<NAME>Nirmal Kumar</NAME>
</NAME.LIST>
<LANGUAGEID> 1033</LANGUAGEID>
</LANGUAGENAME.LIST>
</COSTCENTRE>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>

 

Supported Fields for Employee Record :

ActiveFrom Name AffectsStock Designation
ActiveTo Address ForPayroll PFAccountNumber
DateOfBirth Parent ForJobCosting PANNumber
DateOfJoin Category IsEmployeeGroup ESINumber
DeactivationDate MailingName SortPosition PassportDetails
VisaExpiryDate MobileNumber DefaultLanguage Gender
ContractStartDate MICRCode NumChildren BloodGroup
ContractExpiryDate IFSCode IsChildOfCostCentre FatherName
PassportExpiryDate Narration IsChildOfCategory ContactNumbers
PFJoiningDate BankDetails Alias EmailID
PFRelievingDate Function ActiveFrom BankAccountNumber
IdentityExpiryDate Location ActiveTo VisaNumber
PassportExpiryDate PANNumber DateOfBirth WorkPermitNumber
PFJoiningDate ESINumber DateOfJoin CountryOfIssue
PFRelievingDate PassportDetails DeactivationDate SpouseName
IdentityExpiryDate Gender VisaExpiryDate FPFAccountNumber
Name BloodGroup ContractStartDate ReasonsForLeaving
Address FatherName ContractExpiryDate ESIDispensaryName
Parent ContactNumbers VisaNumber EmpDisplayName
Category EmailID WorkPermitNumber IdentityNumber
MailingName BankAccountNumber CountryOfIssue PRAccountNumber
MobileNumber BankBranch SpouseName RevenueLedForOpBal
MICRCode Narration FPFAccountNumber IdentityNumber
Location BankDetails ReasonsForLeaving PRAccountNumber
Designation Function ESIDispensaryName RevenueLedForOpBal
PFAccountNumber BankBranch EmpDisplayName IFSCode

AuthorNirmal

Technical Geek - Gadget Enthusiast - Loves Programming C#,PHP & IOS - Blogger About