Hello User,
Please check out
this article which will provide more details for OOB auto number.
But Dynamics 365 Sales provides the autonumbering feature, but it doesn’t natively support including related entity data (like the Opportunity ID) directly in the autonumber format. However, here are a couple of approaches you could consider:
Option 1: Combine Autonumber and Workflow/Power Automate
While autonumbering can be used to generate a prefix and sequential number, you could automate appending the Opportunity ID using a workflow or Power Automate flow to update the custom entity record once it is created. Here’s how you can do this:
1. Create a standard autonumber field for your custom entity with the desired prefix and sequence (e.g., ENT-0001, ENT-0002).
2. Use Power Automate to update the autonumber field after the record is created:
Trigger the flow when a custom entity record is created.
Retrieve the related Opportunity ID from the 1:N relationship.
Concatenate the Opportunity ID to the autonumber field (e.g., ENT-OPP12345-0001).
Update the custom entity record with the modified autonumber format.
This approach allows for automation with minimal intervention, but it does require the Power Automate flow to handle the opportunity ID.
Option 2: Custom Plugin (Code-Based)
If you’re open to coding, you can create a plugin that fires on the creation of the custom entity. The plugin can:
1. Generate the sequential number.
2. Retrieve the Opportunity ID from the related entity.
3. Concatenate these parts and update the autonumber field.
This approach is more seamless but involves writing code and deploying a plugin, which may not meet your preference for no automations or coding.
Option 3: Manual Opportunity ID Reference
If including the Opportunity ID in the autonumber isn’t a hard requirement, you can still link the custom entity to the Opportunity via the lookup field, which may simplify things.
In conclusion, Power Automate is your best bet for automating this process without coding while combining autonumber fields with related entity data like the Opportunity ID.
Thank you,
Amit Katariya