Revision History
Download 1.41 Mb. Pdf ko'rish
|
Lacerte SDK Developer Instructions
Summary: This code will write the value 3 to C1_36 of 3rd row in the database. Database Write Example for TY21 First you’ve to determine whether you’ve to consume new api or existing api will work. You can check the same with below code- bool canUseNewApis = new LacerteAccess().CanUseNewApis(2021, 'I'); if canUseNewApis is true then you’ve to use new api otherwise existing code should work fine. Following is the sample code for new Api Lacerte Software Development Kit Developer Instructions pg. 26 if (TAPIStatus.Success == (iStatus = objWriter.UpdateTaxReturn(strAPID, Path.GetDirectoryName(textBoxDBFFileNameWrite.Text), Path.GetFileName(textBoxDBFFileNameWrite.Text), "TEST", textBoxFieldName.Text, textBoxNewValue.Text, 0, string.Empty))) { textBoxWriteStatus.Text = "Success"; } else if (iStatus == TAPIStatus.OutOfIndex) { textBoxWriteStatus.Text = "Out of index write attempt"; } else if (iStatus == TAPIStatus.NotRegistered) { textBoxWriteStatus.Text = "User permission is not granted for using SDK"; } else { textBoxWriteStatus.Text = "Failed, Either field is not exposed for write failed, Status =" + iStatus.ToString(); } Parameters for UpdateTaxReturn 1. String –AppID (App ID which is used for registering) 2. String – DataPath (Lacerte Datapath directory) 3. String – DBFName – DBF name to perform write 4. String – ClientNumber – ClientNumber for which to perform write Lacerte Software Development Kit Developer Instructions pg. 27 5. String – Fieldname to which performing write 6. String – Value (Value to be written) 7. Integer – SubClientID – SubClinetID is applicable only for DATA2 and DATA4 Table Field write, for any other Table you can provide 0 as SubClientID 8. String – StateAbbrev – StateAbbrev is applicable only for DATA3 and DATA4 Table Field write, for any other Table you can provide empty string as StateAbbrev. Return Status: APIStatus – Refer table below for detailed status. Creating a New client using SDK Lacerte client can be created using new SDK as either COM and a .net library, this use case is for those application wants to create client on Lacerte tax application with few properties are exposed to be set during creation. Creation of new client as a .Net library private void buttonCreateClientClick( object sender, EventArgs e) { TAPIStatus status = TAPIStatus.Error; createClientStatus.Text = string .Empty; ILacerteAccess objLacdriverTest = new LacerteAccess(); IClient objClient = objLacdriverTest.CreateClient(); IClientList objClientList = objLacdriverTest.CreateClientList(); status = objClientList.SetDataPath(strAPID, dataPathTex, taxYearTex); if (status == TAPIStatus.Success) { objClient.TaxType = (TaxModule)(taxTypeComboBox.SelectedIndex + 1); objClient.ClientID = “TESTCLIENT”; objClient.EmailID = “test@gmail.com”; objClient.FirstName = “JOHN”; objClient.LastName = “SMITH” try { status = objClientList.CreateClient(objClient); if (status == TAPIStatus.Success) { createClientStatus.Text = "Client created successfully." ; } else if (status == TAPIStatus.DuplicateClient) { createClientStatus.Text = "Error - Duplicate client ID" ; } else { } } Creation of new client as a COM Library Dim strNewValue As String Lacerte Software Development Kit Developer Instructions pg. 28 Dim AccessObj As LacerteSDK_Access.LacerteAccess Dim ClientList As LacerteSDK_Interfaces.IClientList Dim MyNewClient As LacerteSDK_Interfaces.IClient Set ClientList = AccessObj.CreateClientList Set MyNewClient = AccessObj.CreateClient Dim Status As TAPIStatus Status = ClientList.SetDataPath(myAPPID, "C:\Lacerte\18Tax\IDATA\", "2018") If (Status = TAPIStatus_Success) Then Set MyNewClient.ClientID = "CLIENT1" Set MyNewClient.EmailID = "test@gmail.com" Set MyNewClient.FirstName = "JOHN" Set MyNewClient.LastName = "SMITH" Set MyNewClient.TaxType = LacerteSDK_SharedInterfaces.TaxModule.TaxModule_Individual Status = ClientList.CreateClient(MyNewClient) If (Not Status = TAPIStatus_Success) Then 'print - failed with reason At any point any API returns an error code which is not success, this needs to be handled as error with reason as explained in SDK API return code values SDK API Return values: Value Error Code Relevet operation Description 0 Error Read/Write/ Create Error – API call is failed, Check log for more details 1 Success Read/Write/ Create Success – API call succeeded 2 DBFNotAccessable Read/Write/ Create DBF file which is tried to open is not accessible 3 CodeBaseError Read/Write/ Create API call resulted in an internal error which may need application shutdown 4 OutOfIndex Read/Write A call to open/edit a DBF file resulted in an “ index out of range” operation, check the index number being used 5 DBNotSupported Read/Write A call to open a DBF file which is actually not supported 6 NotImplemented Read/Write Current operation on a field is not implemented 7 NotExposed Read/Write/ Create The field is not exposed for a write operation 8 ExposedForRead Read The field is exposed only for read Lacerte Software Development Kit Developer Instructions pg. 29 9 ExposedForWrite Write The field is exposed only for write ExposedForReadWri te Read/W rite The field is exposed only for read/write VersionBlocked Read/Wr Create ite/ Current version of SDK is blocked and an update to latest SDK is required DuplicateClient Create Client ID trying to create already exist in DB LengthExceeded Create Client ID maximum support upto 8 char, all above will return length error TaxModuleMismatc h Create User is trying to create a client where input data for tax module is not mathching DetailCreationError Create Tried to create a client but detail file creation failied DB1Error Create Database error on DB - 1 DB2Error Create Database error on DB - 2 DB3Error Create Database error on DB - 3 DB4error Create Database error on DB - 4 DB5Error Create Database error on DB - 5 DB6Error Create Database error on DB - 6 DB7Error Create Database error on DB - 7 DB8Error Create Database error on DB - 8 InValidClientName Create Client ID entered have special characters InValidTaxYear Create Tax year should be 2018 or above (valid tax year) FieldNotupported Write If a Field is not supported anymore InValidSubClientID Write When provided SubClientID <= 0 for DATA2/DATA4 Table Field Update InValidStateAbbrev Write When provided StateAbbrev is invalid for DATA3/DATA4 Table Field Update Experimenting with Lacerte Test Harness tool The test harness tool is packaged along with the current SDK zip file to experiment with the .Net Library. This tool loads the SDK as a .Net component and performs operations on the database. To use the Test Lacerte Software Development Kit Developer Instructions pg. 30 harness copy the “LacerteSDK.Test.exe” to the SDK install directory. The test application appears as below: Note - In a 64 bit operating system the install directory defaults to C:\Program Files (x86)\Common Files\Lacerte Shared\LacerteSDK for the 32-bit Lacerte SDK Installation and C:\Program Files\Common Files\Lacerte Shared\LacerteSDK for the 64-bit Lacerte SDK Installation. Launching the application will show the following windows: Grant permission to register the test harness with the SDK: By clicking grant user is giving permission to read/write data to/from the Lacerte Datapath. This test harness tool helps to understand what is available in the current version of the .Net Library. You can browse to a DBF file in the IDATA folder by clicking on the browse button. Choose any of the eight DBF files available in the data path. The view will present the data in the DBF file as shown below: Lacerte Software Development Kit Developer Instructions pg. 31 The row number (ROWNO) column is an indication of row index and is not part of the DBF data. In the same fashion, you can write to the DBF file by selecting the DBF file and entering the row and value you would like to write to Field C1_36. Future versions may include additional fields. Known Issues 1. If you have a network installation and during authentication we will get below error: The message below is basically presented if for some reason the SDK logic can’t find certain LacerteTax application data it needs to drive the authentication mechanism. The current requirements are: -LacerteTax application installed and a login through the application has successfully occurred. - 64bit OS -Local system path For Local system path, if your LacerteTax application installation is a workstation installation using a network/shared system path, you can attempt the following workaround: Download 1.41 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling