Post on 15-Apr-2018
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM
Specific Code Change Document
Version 01 Revision date: 3/13/15
Product release: Microsoft NAV 8.00.37874.03.00
Avalara may have patents, patent applications, trademarks, copyrights, or other intellectual property rights
governing the subject matter in this document. Except as expressly provided in any written license
agreement from Avalara, the furnishing of this document does not give you any license to these patents,
trademarks, copyrights, or other intellectual property.
© 2013 Avalara, Inc. All rights reserved.
Avalara, AvaTax, AvaTax Calc, AvaTax Returns, AvaTax Certs, AvaTax Local, AvaLocal, AvaTax POS,
AvaPOS, AvaRates, TrustFile, BPObridge, Laserbridge+, Sales Taxll, Sales TaxPC, SalestaxPC+,
StatetaxII, and StatetaxPC are either registered trademarks or trademarks of Avalara, Inc. in the United
States or other countries.
All other trademarks are property of their respective owners..
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 2 of 15
Changes in Avalara objects ................................................................................................................................................. 4
New object From Avalara.fob........................................................................................................................................... 4
OBJECT Table 14073400 AVA CONFIG ........................................................................................................................ 5
Change in Version List of objects:.............................................................................................................. 5
Add Global variable .................................................................................................................................... 5
Changes in trigger OnInser() .................................................................................................................. 5
Changes in Field Account Value ........................................................................................................... 5
Changes in Field Licence Key ............................................................................................................... 5
Changes in Field Tax Url ....................................................................................................................... 5
Add new Field Tax Url Option With below properties ........................................................................ 6
Object Codeunit 14073301 AVA Tax Engine ................................................................................................................... 7
Change in Version List of objects:.............................................................................................................. 7
Changes in Global Text Constant: .............................................................................................................. 7
Create Functions DummyGetTax ........................................................................................................... 7
Object Codeunit 14073402 AVA IsInstalled ................................................................................................................... 10
Change in Function InitiateAvaInstall .................................................................................................. 10
Change in Function ConfigurationTableData ....................................................................................... 10
Object Page 14073400 AVA Configuration Card .......................................................................................................... 11
Change in Version List of objects:............................................................................................................ 11
Changes in Variable .................................................................................................................................. 11
Add Global variables: ............................................................................................................................... 11
Page Action cmdTestConnection .......................................................................................................... 11
Changes in Caption for following fields: .................................................................................................. 12
Changes in Disable Tax Calc.--> OnValidate........................................................................................... 12
Changes in txtTaxSchID--> OnValidate ................................................................................................... 12
Changes in opTaxSchIDYes--> OnValidate ............................................................................................. 13
Changes in Disable Address Validation--> OnValidate ........................................................................... 13
Remove following Variables: ................................................................................................................... 13
Object Page 14073403 AVA Address Country List ....................................................................................................... 13
Add following Variables: .......................................................................................................................... 13
Change in Function MoveAddressBack: .................................................................................................. 13
Search for below 1st line ........................................................................................................................... 13
Object Page 14073405 AVA Country ListAdd following Variables: ............................................................................... 14
Change in Function MoveAddressBack: .................................................................................................. 14
Search for below 1st line ........................................................................................................................... 14
Object Page 14073523 AVA Reconciliation .................................................................................................................. 14
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 3 of 15
Change in Version List of objects:............................................................................................................ 14
Change in function FnConnect ............................................................................................................ 14
Object MenuSuite 1060 Dept - Add-on Avalara AvaTax ............................................................................................... 15
Add below marked Item in specified location .......................................................................................... 15
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 4 of 15
Changes in Avalara objects
New object From Avalara.fob
Import below new objects
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 5 of 15
OBJECT Table 14073400 AVA CONFIG
Change in Version List of objects:
New Value : AVANA8.00.03.00
Add Global variable Name Data Type Subtype Length
AVAConfig Record AVA CONFIG
Changes in trigger OnInser() Adde below code IF AVAConfig.COUNT = 1 THEN
ERROR('AvaTax configuration already exists');
Changes in Field Account Value
Old value
Account Value
New Value
Account Number
Changes in Field Licence Key
Old value
Licence Key
New Value
License Key
Changes in Field Tax Url Adde below code to OnValidate() Trigger //AVANA8.00.03.00 Start
IF LOWERCASE("Tax Url") = 'https://avatax.avalara.net' THEN
"Tax Url Option" := 0
ELSE IF LOWERCASE("Tax Url") = 'https://development.avalara.net' THEN
"Tax Url Option" := 1
ELSE
"Tax Url Option" := 2;
//AVANA8.00.03.00 End
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 6 of 15
Add new Field Tax Url Option With below properties
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 7 of 15
Object Codeunit 14073301 AVA Tax Engine
Change in Version List of objects:
New Value : AVANA8.00.03.00
Changes in Global Text Constant:
Text14073212 : TextConst 'ENU=NAV 8.00.37874.02.00' Text14073212 : TextConst 'ENU=NAV 8.00.37874.03.00'
Create Functions DummyGetTax Return Value: Name Return Type Length
txtGetResultCode text
Local Variables:
Name Data Type Subtype Length
GetResultCode Integer
RecCompanyInfo Record Company Information
RecAvaConfig Record AVA CONFIG
Local Text Constants:
Name ConstValue
Text14073200 Company Code is not recognized in your Avalara AvaTax Tax Profile. Please check the Company Code and make sure it has been entered correctly. If you continue to get this message, you may need to get your company AvaTax Account Administrator to verify the Company Code setting in the Avalara AvaTax Administration Console.
Text14073201 Company Code is valid.
Text14073202 CompanyNotFoundError
Text14073203 Nexus not found
Text14073204 Company not found. Verify the CompanyCode.
Text14073205 Company not found. Verify the Company Code.
Code
oAddTo := oAddTo.Address; oLine := oLine.Line; oTaxSrv := oTaxSrv.TaxSvc; oGetTaxRequest := oGetTaxRequest.GetTaxRequest; RecCompanyInfo.FINDFIRST; oAddTo.Line1 := RecCompanyInfo.Address; oAddTo.Line2 := RecCompanyInfo."Address 2"; oAddTo.Line3 := ''; oAddTo.City := RecCompanyInfo.City; oAddTo.Region := RecCompanyInfo.County; oAddTo.Country := RecCompanyInfo."Country/Region Code"; oAddTo.PostalCode := RecCompanyInfo."Post Code";
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 8 of 15
oGetTaxRequest.DestinationAddress := oAddTo; oLine.No := '1'; oLine.Qty := 1; oLine.Amount := 100; oLine.ItemCode := 'DUMMY'; oGetTaxRequest.Lines.Add(oLine); RecAvaConfig.FINDFIRST; IF RecAvaConfig."Company ID" <> '' THEN oGetTaxRequest.CompanyCode := RecAvaConfig."Company ID" ELSE oGetTaxRequest.CompanyCode := 'DEFAULT'; oGetTaxRequest.DocCode := 'DUMMY'; oGetTaxRequest.DocDate := CURRENTDATETIME; oGetTaxRequest.DocType := 0; oGetTaxRequest.DetailLevel := 3; oGetTaxRequest.CustomerCode := 'DUMMY'; RecAvaConfig.FINDFIRST; oTaxSrv.Profile.Client:=RecAvaConfig."Connector Version"; oTaxSrv.Configuration.Security.Account:=RecAvaConfig."Account Number"; oTaxSrv.Configuration.Security.License:=RecAvaConfig."License Key"; oTaxSrv.Configuration.Url:=RecAvaConfig."Tax Url"; oGetTaxResult:=oTaxSrv.GetTax(oGetTaxRequest); IF (oGetTaxResult.ResultCode > 0) AND (oGetTaxResult.Messages.Count > 0) THEN BEGIN IF NOT CallforGetTax THEN BEGIN IF oGetTaxResult.Messages.Item(0).Name <> Text14073202 THEN txtGetResultCode := Text14073201 ELSE BEGIN GetResultCode:=oGetTaxResult.ResultCode; txtGetResultCode := oGetTaxResult.Messages.Item(0).Summary; IF txtGetResultCode = Text14073204 THEN txtGetResultCode := Text14073205; END; END ELSE BEGIN GetResultCode:=oGetTaxResult.ResultCode; txtGetResultCode := oGetTaxResult.Messages.Item(0).Summary; IF txtGetResultCode = Text14073204 THEN txtGetResultCode := Text14073205; END; END ELSE BEGIN GetResultCode:=0; IF oGetTaxResult.TotalTax <> 0 THEN txtGetResultCode := Text14073201
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 9 of 15
ELSE txtGetResultCode := Text14073203; END;
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 10 of 15
Object Codeunit 14073402 AVA IsInstalled
Change in Function InitiateAvaInstall Search for below 1st line
AvaInstall.Release := 1; AvaInstall.INSERT; END ELSE AvaInstall.FINDFIRST; END;
Change in Function ConfigurationTableData Search for below 1st line and delete colored lines
"Tax Group No.":='AVATAX'; "Batch Address Vlid" :=TRUE; //"Client Log":=TRUE;//Avalara++-- //"Request Time":=300; "Display Warnings":=TRUE; "Entity\Use":=TRUE; Adapter:=AdapterVer; "Company ID":=CompCode; "Connector Version":=AdapterV; "Expiery Date":=ExpityDate; "Shipping Code":=FR; "Misc. Code":=HNLD; "Show Statistics":=TRUE;
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 11 of 15
Object Page 14073400 AVA Configuration Card
Change in Version List of objects:
New Value : AVANA8.00.03.00
Changes in Variable Text14073211 : TextConst NAV 8.00.37874.03.00
Add Global variables: Name DataType Subtype Length
RecAVASetUpAssistant Record AVA Setup Assistant
RecAVAAddressCountry Record
AVA Address
Country
RecTaxJurisdiction Record Tax Jurisdiction
Page Action cmdTestConnection "Tax Group No.":='AVATAX'; "Batch Address Vlid" :=TRUE; //"Client Log":=TRUE; //"Request Time":=300; "Display Warnings":=TRUE; "Entity\Use":=TRUE; "Shipping Code":='FR'; "Misc. Code":='HNLD'; "Show Statistics":=TRUE; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant.Credentials := ''; RecAVASetUpAssistant."Valid Account Credentials":= FALSE; RecAVASetUpAssistant.MODIFY; END ELSE BEGIN RecAVASetUpAssistant."Primary Key" := ''; RecAVASetUpAssistant.Credentials := ''; RecAVASetUpAssistant."Valid Account Credentials":= FALSE; RecAVASetUpAssistant.INSERT; END; END ELSE BEGIN RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant.Credentials := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Valid Account Credentials":= TRUE; RecAVASetUpAssistant.MODIFY; END ELSE BEGIN RecAVASetUpAssistant."Primary Key" := ''; RecAVASetUpAssistant.Credentials := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Valid Account Credentials":= TRUE;
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 12 of 15
RecAVASetUpAssistant.INSERT; RecAVAAddressCountry.RESET; RecAVAAddressCountry.SETRANGE(Code,'00'); IF RecAVAAddressCountry.COUNT = 0 THEN BEGIN RecAVAAddressCountry.INIT; RecAVAAddressCountry.Code:='00'; RecAVAAddressCountry.Name:='No Country Name'; RecAVAAddressCountry.Check := TRUE; RecAVAAddressCountry."Form Check" := TRUE; RecAVAAddressCountry.INSERT; END; END; END; "Connector Version":= Text14073211;//AVAGetConnectorVersionNumber; AccountValueEnable :=FALSE;
Changes in Caption for following fields:
Name Caption
txtAccountURL Web Service URL
txtCompanyID Company Code
Changes in Disable Tax Calc.--> OnValidate IF "Disable Tax Calc." THEN BEGIN IF NOT DIALOG.CONFIRM('Do you want to disable Tax Calculation ?', TRUE) THEN "Disable Tax Calc.":=FALSE; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; END;
Changes in txtTaxSchID--> OnValidate RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecTaxJurisdiction.RESET; RecTaxJurisdiction.SETRANGE(Code,"Tax Group No."); IF RecTaxJurisdiction.FINDFIRST THEN BEGIN IF RecTaxJurisdiction."Tax Account (Sales)" <> '' THEN BEGIN RecAVASetUpAssistant."TAX Schedule ID" := 'Verified on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant."Mapped GL Accounts":= TRUE; RecAVASetUpAssistant."Mapped Tax Area Code" := TRUE; END ELSE BEGIN RecAVASetUpAssistant."TAX Schedule ID" := ''; RecAVASetUpAssistant."Mapped GL Accounts":= FALSE; RecAVASetUpAssistant."Mapped Tax Area Code" := FALSE; END; END ELSE
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 13 of 15
RecAVASetUpAssistant."TAX Schedule ID" := ''; RecAVASetUpAssistant.MODIFY; END;
Changes in opTaxSchIDYes--> OnValidate IF Initiate = Initiate::"0" THEN BEGIN NoAVAINITIATEOnValidate; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; END;
Changes in Disable Address Validation--> OnValidate IF "Disable Address" THEN BEGIN IF NOT DIALOG.CONFIRM('Do you want to disable Address Validation ?', TRUE) THEN "Disable Address":=FALSE; //IF ISCLEAR (AVA_WshShell) THEN //CREATE (AVA_WshShell,FALSE,TRUE); //AVA_WshShell.SendKeys ('{F5}'); CurrPage.UPDATE; END; AvaAddressEnableDisable; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN IF "Disable Address" THEN RecAVASetUpAssistant."Address Validation" := '' ELSE RecAVASetUpAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant.MODIFY; END;
Remove following Variables:
Name DataType Subtype Length
--Build 017-- Integer
AVA_WshShell Automation
Object Page 14073403 AVA Address Country List
Add following Variables: Name DataType Subtype Length
RecAvaConfig Record AVA CONFIG
RecAVASetUpAssistant Record AVA Setup Assistant
Change in Function MoveAddressBack:
Search for below 1st line
RecAvaCountry.SETRANGE(RecAvaCountry.Code); AVAAddressCountry.DELETE;
Avalara AvaTax for Microsoft Dynamics NAV 2015 RTM Specific Code Change Document
© Avalara Inc. All rights reserved. Page 14 of 15
//AVANA8.00.03.00 START RecAvaConfig.FINDFIRST; RecAVASetupAssistant.RESET; IF RecAVASetupAssistant.FINDFIRST THEN BEGIN RecAVASetupAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetupAssistant.MODIFY; END; //AVANA8.00.03.00 END COMMIT; UNTIL AVAAddressCountry.NEXT = 0; END;
Object Page 14073405 AVA Country ListAdd following Variables:
Name DataType Subtype Length
RecAvaConfig Record AVA CONFIG
RecAVASetUpAssistant Record AVA Setup Assistant
Change in Function MoveAddressBack:
Search for below 1st line
AVACountry."Avalara Validate":=TRUE; AVACountry.MODIFY; //AVANA8.00.03.00 START RecAvaConfig.FINDFIRST; RecAVASetUpAssistant.RESET; IF RecAVASetUpAssistant.FINDFIRST THEN BEGIN RecAVASetUpAssistant."Address Validation" := 'Enabled on '+ FORMAT(CURRENTDATETIME); RecAVASetUpAssistant.MODIFY; END; //AVANA8.00.03.00 END UNTIL AVACountry.NEXT = 0; END;
Object Page 14073523 AVA Reconciliation
Change in Version List of objects:
New Value : AVANA8.00.03.00
Change in function FnConnect Old Value
oTaxSvc.Profile.Client:='NAV 8.00.37874.01.00';
New Value
oTaxSvc.Profile.Client:=AvaConfig."Connector Version";