In Business Central, when you need to handle the removal of fields and procedures to ensure that other extensions are not affected by these changes, you typically follow a two-step deprecation process. This allows other developers and users to adapt to the changes before they are fully enforced. Here are the steps to handle the removal:
Mark as Obsolete: In the first version where the decision to remove the field or procedure is made, you set the ObsoleteState to Pending and provide an ObsoleteReason. This doesn't remove the feature but indicates to users and developers that it will be removed in the future. This step is crucial for backward compatibility.
Removal: In a subsequent version, after users have had time to adapt to the deprecation warning, you can then remove the field or procedure or set the ObsoleteState to Removed.
Based on these guidelines, here are the three actions you should perform in sequence:
Set the Description field as ObsoleteState = Pending and ObsoleteReason = 'Not in use' in version 2.0.0.0.
Set the Clone procedure as ObsoleteState = Pending and ObsoleteReason = 'Not in use' in version 2.0.0.0.
Remove the Description field from the Issue table in version 2.0.0.1.
These steps will ensure that anyone using the Description field or Clone procedure will receive a warning about the pending deprecation before it is actually removed, thereby minimizing the impact on other extensions and providing a clear path for migration.
When handling the removal of fields and procedures in Microsoft Dynamics 365 Business Central, the process should be carried out in a way that allows other extensions or dependent features to adapt to the changes without causing immediate failures.
Set Obsolete State and Reason for Description Field (Version 2.0.0.0): The first step involves marking the Description field as obsolete by setting the ObsoleteState to 'Pending'. This is a non-breaking change, signaling to other developers and users that the field is planned for removal in a future version. An ObsoleteReason should also be provided to explain why the field is being deprecated.
Set Obsolete State and Reason for Clone Procedure (Version 2.0.0.0): Similarly, the Clone procedure should be marked as obsolete with the ObsoleteState set to 'Pending'. This indicates that the procedure is no longer in use and will be removed in the future. Providing an ObsoleteReason is best practice as it explains the rationale behind the decision.
Remove the Description Field (Version 2.0.0.1): In the subsequent version, after the developers and users have been given time to adapt to the deprecation notice, the Description field can be safely removed from the Issue table. This is considered a breaking change, hence it is done after the field has been marked as obsolete in a previous version.
The reason for not removing the Description field and Clone procedure immediately in version 2.0.0.0 is to avoid causing runtime errors for any extensions or integrations that may depend on these components. By following this sequence, you provide a clear deprecation path that helps maintain the stability of the overall system while evolving the schema.