Setting a Default Value for Product Type in D365F&O
Hi everyone!
I recently received a requirement to set the default Product Type as "Service" across all the forms where a product is created in Dynamics 365 Finance and Operations (D365F&O).
This includes:
Product
Product Master
Released Product
All of these are accessed under the Product Information Management module. The goal was to streamline the process and reduce manual errors during product creation by preselecting "Service" instead of the default "Item".
In this article, I’ll Walk you through how I approached this change, the methods available, and the best practices to consider when modifying default values in D365F&O forms.
Initially, I tried several ways to implement this change, but none of them worked as expected. The issue was that the EcoResProductCreate form is a Dialog-based form, which behaves differently from regular forms and doesn’t allow direct customization in the same way.
After some debugging and analysis, I discovered a key class that controls this behavior:
👉
The class contains methods responsible for setting default values during product creation, specifically for:
Product Type
Product Subtype
To solve this, I used Chain of Command (CoC) to extend the method of the class.
Here’s the sample code I used:
After applying this extension, "Service" is now automatically selected as the Product Type across all relevant product creation forms—helping end-users save time and reduce potential mistakes during data entry.
D365 F&SCM Consultant & Developer | Finance & SCM | X++ | Multilingual
4moGreat tweak 👍
D365fo Technical consultant.
4mo💡 Great insight..