Blog

31 03, 2022

App Checker BaseX error

By |2022-03-31T13:01:20+02:00March 31st, 2022|Categories: Dynamics 365 for Finance and Operations, MSDyn365FO|Tags: , , , , |0 Comments

The Microsoft Dynamics Application Checker is an excellent tool, which utilizes the BaseX XML-parsing software. Since all our objects and source code for Microsoft Dynamics 365 are represented as XML files, this presents an excellent opportunity to do XPath parsing. As a prerequisite for the software first, before you could include it in your build routine. We have seen an App Checker BaseX error like this:

Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Invalid maximum heap size: -Xmx15000m The specified size exceeds the maximum representable size.

When you deploy BaseX, it is recommended to increase the usable memory size in order to fit the entire Dynamics repository. Increasing the memory usage can result in the above error message. The solution is to deploy the 64-bit Java Runtime Environment, which makes the App Checker BaseX error disapper.

You can learn more about the tool here:

https://github.com/microsoft/Dynamics365FO-AppChecker

I also have blogged about it before on how to write custom scripts to traverse in BaseX. Have a look at it here.

App Checker BaseX error
31 03, 2022

Incorrect auto upgrade on custom methods

By |2022-03-31T11:51:24+02:00March 31st, 2022|Categories: AX 2012, Dynamics 365 for Finance and Operations, MSDyn365FO|Tags: , , , , |0 Comments

During our upgrade journey from AX 2012 to Microsoft Dynamics 365 Finance and Operations we have noticed some problems. The automated code upgrade tool available on LifeCycle Services for your modelstore did an incorrect auto upgrade on custom methods.

When we did the first builds, the following error message was showing up for various code pieces:

Compile Fatal Error: Table dynamics://Table/CCMTmpQuestions: [(39,5),(39,6)]: Unexpected token '/' specified outside the scope of any class or model element.

After checking the source code we have identified that somehow it has inserted extra lines at the end of some table methods, with a single / sign in them:

incorrect auto upgrade on custom methods

The quickest way to locate all those methods are to use our favorite file manager and search tool, Total Commander.

You can press <ALT>+<F7> and do a file search for *.xml in your \AOSService\PackagesLocalDirectory\[YourPackageName] folder for the following Regular expression value. You must tick the RegEx checkbox:

(^    \/)$

This has revealed all incorrect files, which we could fix in bulk. You can use similar approach as above to quickly find anything in the file-based Dynamics 365 Finance and Operations code repository.

Once you quick-replace these characters with a blank line, you are done fixing the incorrect auto upgrade on custom methods.

31 03, 2022

What are the SQL Server Jobs which looks like a GUID?

By |2022-03-31T11:46:55+02:00March 31st, 2022|Categories: AX 2012, Microsoft Dynamics AX|Tags: , |0 Comments

If you have ever encountered SQL Server Jobs which looks like a GUID value, you might have wondered what they are used for.

Our AX 2012 deployment is using a SQL Server Reporting Services instance, which is used for two purposes:

  • AX 2012 SSRS reports
  • Custom reporting from our Data warehouse

These jobs are actually periodically generated SSRS reports scheduled by our staff. Each job belongs to a different person and report.

By just having a look at the job itself does not reveal what is actually being executed, but the following T-SQL script can extract the details when you run it against the ReportServer database:

SELECT
c.Name AS ReportName,
S.ExtensionSettings,
'Next Run Date' = CASE next_run_date
WHEN 0 THEN null
ELSE
substring(convert(varchar(15),next_run_date),1,4) + '/' +
substring(convert(varchar(15),next_run_date),5,2) + '/' +
substring(convert(varchar(15),next_run_date),7,2)
END,
'Next Run Time' = isnull(CASE len(next_run_time)
WHEN 3 THEN cast('00:0'
+ Left(right(next_run_time,3),1)
+':' + right(next_run_time,2) as char (8))
WHEN 4 THEN cast('00:'
+ Left(right(next_run_time,4),2)
+':' + right(next_run_time,2) as char (8))
WHEN 5 THEN cast('0' + Left(right(next_run_time,5),1)
+':' + Left(right(next_run_time,4),2)
+':' + right(next_run_time,2) as char (8))
WHEN 6 THEN cast(Left(right(next_run_time,6),2)
+':' + Left(right(next_run_time,4),2)
+':' + right(next_run_time,2) as char (8))
END,'NA'),
Convert(XML,[ExtensionSettings]).value('(//ParameterValue/Value[../Name="TO"])[1]','nvarchar(100)') as [To]
,Convert(XML,[ExtensionSettings]).value('(//ParameterValue/Value[../Name="CC"])[1]','nvarchar(100)') as [CC]
,Convert(XML,[ExtensionSettings]).value('(//ParameterValue/Value[../Name="BCC"])[1]','nvarchar(100)') as [BCC]
,Convert(XML,[ExtensionSettings]).value('(//ParameterValue/Value[../Name="RenderFormat"])[1]','nvarchar(50)') as [Render Format]
,Convert(XML,[ExtensionSettings]).value('(//ParameterValue/Value[../Name="Subject"])[1]','nvarchar(50)') as [Subject]
/*,Convert(XML,[Parameters]).value('(//ParameterValue/Value[../Name="StartDateMacro"])[1]','nvarchar(50)') as [Start Date]
,Convert(XML,[Parameters]).value('(//ParameterValue/Value[../Name="EndDateMacro"])[1]','nvarchar(50)') as [End Date]
,Convert(XML,[Parameters]).value('(//ParameterValue/Value[../Name="Currency"])[1]','nvarchar(50)') as [Currency]*/
,[LastStatus]
,[EventType]
,[LastRunTime]
,[DeliveryExtension]
,[Version]
FROM 
 dbo.[Catalog] c
INNER JOIN dbo.[Subscriptions] S ON c.ItemID = S.Report_OID
INNER JOIN dbo.ReportSchedule R ON S.SubscriptionID = R.SubscriptionID
INNER JOIN msdb.dbo.sysjobs J ON Convert(nvarchar(128),R.ScheduleID) = J.name
INNER JOIN msdb.dbo.sysjobschedules JS ON J.job_id = JS.job_id

Now we have the details of:

  • what reports were scheduled
  • the report format
  • execution status
  • schedule and last successful run time.
SQL Server Jobs which looks like a GUID

This should give you a better overview about what are the SQL Server Jobs which looks like a GUID value in your database instance.

1 07, 2020

Dynamics Virtual Community Summit

By |2020-07-01T09:18:44+02:00July 1st, 2020|Categories: Dynamics 365 for Finance and Operations|Tags: , , , |0 Comments

This year the usual AXUG Summit Europe has been delayed due to the Coronavirus pandemic, and is happening online now this week, called Dynamics Virtual Community Summit. You may join a lot of interesting sessions using the conference website.

Dynamics Community Virtual Summit

I will be participating in 3 sessions:

  1. Pushing the Limits of D365FO – An Enterprise-scale Data Upgrade
    2020-07-01 11:00-12:00 CET

    How do you make a decision about a green-field, or an upgrade implementation? What gold are you leaving behind if you do not get your data in the cloud? JJ Food Service has been on a journey upgrading their AX 2012 R3 environment to Dynamics 365 for Finance and Operations, with 15 years of historical data and a 2 TB database size, rolled forward since the beginning of time. Join our technical expert, Vilmos Kintera (Business Applications MVP) on this session to get first-hand experience of the challenges, tasks and logistics involved to be cloud-ready.

    This is a slightly updated version of the webinar available on the Dynamics Zero-to-Hero YouTube channel.

  2. What is the Latest in D365FO Application Development?
    2020-07-02 12:15-13:15 CET

    Learn about the latest and greatest changes around Development and Application Life-cycle Management for Microsoft Dynamics 365 for Finance, Operations / Supply Chain Management. We will discuss recent and upcoming changes.

  3. Ask the Experts: A Roundtable for Finance and Operations Questions and Concerns
    2020-07-03 15:30-16:00 CET

    Join us for this roundtable session with finance and operations experts to discuss and answer questions that deal your most pressing issues. Some topics for conversation may include:   local roll outs in various countries,  data migration considerations,  and more!

31 03, 2020

Interpreting compiler results in D365FO using PowerShell

By |2022-03-29T18:27:05+02:00March 31st, 2020|Categories: Dynamics 365 for Finance and Operations, MSDyn365FO|Tags: , , , , , , , , |0 Comments

When you build your code, the results are hard to interpret and are being capped at 1000 entries per category within the Visual Studio error pane. The compiler does generate output files with more valuable content within each package. We have written PowerShell code for analyzing and interpreting compiler results of Microsoft Dynamics 365 for Finance and Operations in a more meaningful way.

The BuildModelResult.LOG and XML files have the details of your errors, warnings and tasks. Running the following script parses these files and counts the warnings and errors, to get a better idea of the remaining work during your implementation and upgrade:

$displayErrorsOnly = $false # $true # $false
$rootDirectory = "C:\AOSService\PackagesLocalDirectory"

$results = Get-ChildItem -Path $rootDirectory -Filter BuildModelResult.log -Recurse -Depth 1 -ErrorAction SilentlyContinue -Force
$totalErrors = 0
$totalWarnings = 0

foreach ($result in $results)
{
    try
    {
        $errorText = Select-String -LiteralPath $result.FullName -Pattern ^Errors: | ForEach-Object {$_.Line}
        $errorCount = [int]$errorText.Split()[-1]
        $totalErrors += $errorCount

        $warningText = Select-String -LiteralPath $result.FullName -Pattern ^Warnings: | ForEach-Object {$_.Line}
        $warningCount = [int]$warningText.Split()[-1]
        $totalWarnings += $warningCount

        if ($displayErrorsOnly -eq $true -and $errorCount -eq 0)
        {
            continue
        }

        Write-Host "$($result.DirectoryName)\$($result.Name) " -NoNewline
        if ($errorCount -gt 0)
        {
            Write-Host " $errorText" -NoNewline -ForegroundColor Red
        }
        if ($warningCount -gt 0)
        {
            Write-Host " $warningText" -ForegroundColor Yellow
        }
        else
        {
            Write-Host
        }
    }
    catch
    {
    Write-Host
    Write-Host "Error during processing"
    }
}

Write-Host "Total Errors: $totalErrors" -ForegroundColor Red
Write-Host "Total Warnings: $totalWarnings" -ForegroundColor Yellow

The compiler results are displayed in the following format as an overview:

compiler results

If you want to do a detailed analysis, we also have PowerShell scripts prepared for extracting the errors and saving them in a CSV file for better processing. Opening it with Excel allows you to format them into a table.

We typically copy all error texts to a new sheet, run the duplicate entries removal, then do a count on what is the top ranking error to see if we have any low-hanging fruits to be fixed.

=SUMPRODUCT(('JADOperation-Warning'!$D$2:$D$1721=Sheet1!A2)+0)

You could be very efficient about deciding what things to fix first and next, and is easier to delegate tasks this way.

Source code for all four scripts are available on GitHub.

Go to Top