Monday, 16 December 2024

Business Central v25.1 Upgrade Challenge with Master Data Management app

 

Recently, while upgrading version 25.1, we encountered a critical error related to the Master Data Management app by Microsoft. This error halted the upgrade process, presenting the following message:

Error Details:

Could not upgrade the extension '_Exclude_Master_Data_Management' by 'Microsoft' from version '22.0.54157.55195' to '25.1.25873.25900' for tenant 'default' and company 'CRONUS USA, Inc.' due to the following error:

 

'Call to the function 'MODIFY' is not allowed inside the call to 'OnUpgradePerCompany' when it is used as a TryFunction.'

 

AL stack trace: 

  "Master Data Mgt. Upgrade"(CodeUnit 7238).TryModify line 2 - _Exclude_Master_Data_Management by Microsoft

  "Master Data Mgt. Upgrade"(CodeUnit 7238).UpgradeJobQueueEntryFrequencies line 33 - _Exclude_Master_Data_Management by Microsoft

  "Master Data Mgt. Upgrade"(CodeUnit 7238).OnUpgradePerCompany line 2 - _Exclude_Master_Data_Management by Microsoft

  "Upgrade Triggers"(CodeUnit 2000000008).OnUpgradePerCompany(Event) line 2.

Root Cause

The issue was from the Master Data Management app attempting to use the MODIFY function within a TryFunction during the OnUpgradePerCompany process.

A fix has been promised in the upcoming cumulative updates for Business Central. However, until the fix is officially released, users upgrading to version 25 may face this issue.

Temporary Workaround

To bypass the error and proceed with the upgrade, you can temporarily adjust the DisableWriteInsideTryFunctions property in the server instance configuration.

Steps to Apply the Workaround:

Import-Module 'C:\Program Files\Microsoft Dynamics 365 Business Central\250\Service\NavAdminTool.ps1'

Set-NAVServerConfiguration -ServerInstance BC250 -KeyName DisableWriteInsideTryFunctions -KeyValue false

Restart-NAVServerInstance BC250

 

Important Note:

Use this as a temporary solution and revert the DisableWriteInsideTryFunctions property to true once the upgrade is complete.

 

 


Monday, 2 December 2024

Why My Custom Table/Page Isn't Appearing in "Search Company Data" in Business Central – And How to Fix It?

If you've ever added a custom table/Page in Microsoft Dynamics 365 Business Central and found that it doesn't show up in the "Search Company Data" feature to enable, you're not alone. This post will explain why this happens and how to fix it with a simple solution.


The Problem: Custom Table/Page Missing in "Search Company Data"

The "Search Company Data" feature allows users to search across various tables in Business Central. However, if your custom table or page isn’t configured correctly, it won’t appear in the “Enable lists for searching”. This can be frustrating.

Symptoms:

  • Your custom table or page does not appear in the “Enable lists for searching”.
  • Other standard tables/pages show up as expected.
  • You can still manually navigate to your custom table or page, but not through "Search Company Data".

Root Cause: Missing “LookupPageId” Property

In Business Central, tables need to have a LookupPageId property defined to be searchable through the "Search Company Data" feature.

If this property is not set, the system cannot determine how to present the table’s data in the search results, hence excluding it.


The Solution: Setting the LookupPageId Property

To resolve this issue, you need to set the LookupPageId property in your custom table.





Conclusion

By simply setting the LookupPageId property, you ensure your custom table/page is visible in the “Enable lists for searching” list.