Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction. Introduction Corey Vantilborg 4 Years Dedicated AX Administrator at a Manufacturing Company Responsible for all aspects of technical.

Similar presentations


Presentation on theme: "Introduction. Introduction Corey Vantilborg 4 Years Dedicated AX Administrator at a Manufacturing Company Responsible for all aspects of technical."— Presentation transcript:

1

2 Introduction

3 Corey Vantilborg 4 Years Dedicated AX Administrator at a Manufacturing Company Responsible for all aspects of technical implementation Acted as SME for Manufacturing group for majority of project Developer as required

4 Dynamics AX @ Tigercat Multi-Company, Multi-Site implementation
Two Primary companies are both manufacturing (1 OEM and 1 Custom) Implementation began with selection process in late 2011 Initial go-live in July 2014 Final Go-Live completing this year Many modifications including large ISV (Annata IDMS)

5 PREMIUM FORESTRY EQUIPMENT
Release date 15 April 2016 30 May 2016 – Removed South Korean distributor PREMIUM FORESTRY EQUIPMENT

6 Who we are… Privately owned Canadian corporation
Industry leader in forestry equipment design Strong engineering and manufacturing capabilities Customer-driven innovation Worldwide dealer network

7 2016 profile 9 manufacturing locations in southern Ontario
Parts facilities in Ailey, Georgia and Hede, Sweden 1,300 employees 138 dealers around the world: Canada, US, South America, Africa, Western Europe, Russia, Australia and New Zealand Complete lineup of forestry and off-road industrial equipment 17,000 machines built and counting!

8 Advanced manufacturing

9 In the field

10 In the field

11 In the field

12 Corey Vantilborg, Tigercat Industries
AX Admin Grab Bag Corey Vantilborg, Tigercat Industries #CollaborateCanada

13 Agenda General SQL Tasks X++ Job Tips / Tricks
PowerShell Scheduled Task

14 What is an AX Admin General Technical responsibility
Needs to have multi-discipline knowledge if not expertise Familiar with the various technologies that make up the AX Microsoft stack Familiar with the AX functional application Familiar with integrations Familiar with customizations

15

16 General Notes The tasks that will be discussed could cause data corruption if not used correct. Be careful and test. Take lots of notes, notes have saved me more than any other thing I have done as an AX Admin

17 Daily Check Automation

18 Get AOS Status $AOSService = "AOS60`$01" #Note escape characters to get current AOS instance #Looping through each AOS to check the service foreach ($AOS in 'AXAOSAV01.TCII.LOCAL', 'AXAOSSAV03.TCII.LOCAL','AXAOSSAV05.TCII.LOCAL','AXAOSSAV06.TCII.LOCAL', 'AXAOSSAV07.tcii.local') { if (((Get-Service $AOSService -ComputerName AXAOSSAV03.TCII.LOCAL).Status) -eq 'Running') $body = $body + "`n`t$AOS Is running" } else { {$body = $body + "`n`t$AOS Is Stopped"} -Note AOS Escape character

19 Get SQL Drive Space #Loop through drives on SQL Server
$Body = $Body + "`n`n SQLSAV01 Drive Space " foreach($drive in "X:","Y:","Z:") { $disk = Get-WmiObject Win32_LogicalDisk -ComputerName SQLSAV01.tcii.LOCAL -Filter "DeviceID='$drive'" | Select-Object Size,FreeSpace, volumename $PercentFree = ($disk.FreeSpace/$disk.Size)*100 $DiskName = $disk.volumename $Body = $Body + "`n`tDrive $diskName $Drive Free Space: $percentfree" }

20 Get Last MRP Run Details
#Look-up Last MRP Run $Body = $Body + "`n`n Last MRP Results " $sqlsession = New-PSSession -ComputerName SQLSAV01 $Results = Invoke-Command -Session $sqlsession -ScriptBlock { Import-Module sqlps -DisableNameChecking $DbServer = 'SQLSAV01\AXDB' $AXDB = 'TCI_AX2012R2_Prod' $SQLMRPLookup = "select reqlogid ,cast(reqlog.startdatetime as date) as RunDate ,datediff(n, reqlog.STARTDATETIME, reqlog.ENDDATETIME) as runtime ,NUMOFITEMS as NumberOfItems ,reqlog.TIMEUPDATE ,reqlog.TIMEACTION ,reqlog.TIMECOVERAGE ,reqlog.TIMEFUTURES from REQLOG where REQPLANID = 'MasterPlan' and reqlog.DATAAREAID = 'TIND' and reqlog.NUMOFITEMS > and cast(reqlog.ENDDATETIME as date) = cast (getdate() as date) " invoke-sqlcmd -query $SQLMRPLookup -serverinstance $DbServer -database $AXDB } Remove-PSSession $sqlsession -Relies on PS Remoting

21 X++ Job Tips

22 X++ Use Cases Data Corrections Code Testing Data Migration Validations
Generally only in development Data Migration

23 Best Practices for X++ Data Jobs
Develop/Validate in Pre-Production Do not use Update_Recordset Performance shouldn’t be a concern for Data Jobs Keep Track of change made Name Job in a reasonable way Provide Read-Only option to validate logic Over commenting not a problem with Jobs -I break my own best practices constantly -

24 Data Update Example #1 CAVAXDEV
static void SerialNumberBOMBackflushFix(Args _args) { //CAV Created to correct automatically backflushing serial numbers ProdBOM prodBOM; InventTable inventTable; ProdTable prodTable; EcoResTrackingDimensionGroup ecoResTrackingDimensionGroup; EcoResTrackingDimensionGroupItem ecoResTrackingDimensionGroupItem; InventTable itemUpdate; NoYes update = NoYes::No; //Control if update happens or just test ttsBegin; While select forUpdate ProdBOM join InventTable where inventTable.ItemId == prodbom.ItemId join prodTable where prodtable.ProdId == prodBOM.ProdId && prodTable.ProdStatus < ProdStatus::ReportedFinished join ecoResTrackingDimensionGroupitem where EcoResTrackingDimensionGroupItem.ItemId == prodBOM.ItemId join ecoResTrackingDimensionGroup where ecoResTrackingDimensionGroup.RecId == EcoResTrackingDimensionGroupItem.TrackingDimensionGroup && ecoResTrackingDimensionGroup.Name like 'TC_Serial' && prodBOM.ProdFlushingPrincip != ProdFlushingPrincipBOM::Manual && prodBOM.InventDimId == '021832' //Only Update a specific site/warehouse if(update) prodBOM.ProdFlushingPrincip = ProdFlushingPrincipBOM::Manual; prodBOM.update(); } info(prodBOM.ItemId + "," + prodBOM.ProdId + "," + ecoResTrackingDimensionGroup.Name); ttsCommit; CAVAXDEV

25 Infolog Size Limit Macro in \Classes\Info\viewBuild controls the size limit of the Infolog

26 Example of Daily Work

27 Problem Uses reporting that some firmed Planned Orders were not deleted from Planned Orders screen Issue happened during a brief period when an AOS was acting erratically

28 Confirmation and Scoping
select reqpo.DATAAREAID ,reqpo.REFID ,reqpo.itemid ,reqpo.REQPOSTATUS ,REQTRANSFIRMLOG.INVENTTRANSREFID ,REQTRANSFIRMLOG.REQFIRMDATE from REQPO join REQTRANSFIRMLOG on REQTRANSFIRMLOG.REFID = reqpo.REFID and REQTRANSFIRMLOG.DATAAREAID = REQPO.DATAAREAID

29 X++ Job to Correct Issue
static void DeleteFirmedReqPO(Args _args) { ReqPO reqPO; ReqTransFirmLog log; NoYes delete = NoYes::No; int i; while select forUpdate * from reqPO join log where log.RefId == reqPO.RefId i++; if(delete) ttsBegin; reqPO.delete(); ttsCommit; } info("Number of Records Affected: " + int2str(i)); AXAOSUAT

30 A tale of horror

31 The Beginning After a data migration it was discovered that newly created BOMlines did not have correct inventory dimensions assigned A quick X++ Job was written to correct the issue This job was tested and validated in our UAT environment; passed the validation The job was then run in live and all seemed well. Demo Job on CAVAXDEV \Jobs\AssignBOMLineSite

32 The Issue At some point the next day an issue was discovered.
The X++ job had removed the warehouse from all BOM lines. This was not caught during UAT validation because many of our groups use Resource Consumption on the BOM line and don’t care about the warehouse. As it had been 24hrs plus since the data was broken, a full DB restore was not possible

33 The Solution Restore data using SQL Update command
Source of data is a restored db backup Column is easily restored by joining restored databased to destination on recID Only works for records that exist in both databases

34 Complete Process Restore a full copy of the data to a new database in preproduction Use the sql Update command to restore a single column from the restored data to the preproduction environment Use a simple SQL select to confirm the data had been restored Use the Dynamics AX consistency Check on the affected table Link the PreProduction SQL server to the Production Server Run the SQL Update command to restore data from the linked server to the production server

35 Recovery Demo

36 Thank You Corey Vantilborg, Tigercat Industries
Twitter: @CoreyVantilborg Please Remember to Fill our session surveys #CollaborateCanada


Download ppt "Introduction. Introduction Corey Vantilborg 4 Years Dedicated AX Administrator at a Manufacturing Company Responsible for all aspects of technical."

Similar presentations


Ads by Google