Project Number Conflicts with Project Number in Dynamics AX – Subproject Validation Explained
The Problem
When the project ID number sequence is set to manual, creating projects with IDs that are substrings of each other (e.g. 1234 followed by 12345) triggers the error:
"Project number conflicts with project number 1234."
The first project creates successfully, but the second fails validation.
Root Cause
The issue originates from a validation in the ProjTable form's validateWrite() method. The code iterates through the new project ID, progressively trimming the last character and checking whether a matching project already exists:
if (!projTable.RecId)
{
if (!projTable.ParentId)
{
while (projHier)
{
projHier = subStr(projHier, 1, strLen(projHier) - 1);
if (ProjTable::exist(projHier) && projHier != projTable.ParentId)
{
return checkFailed(strFmt("@SYS53140", projHier));
}
}
if (ProjTable::like(projTable.ProjId + '*'))
{
return checkFailed(strFmt("@SYS53140", ProjTable::findLike(projTable.ProjId + '*').ProjId));
}
}
}
When creating project 12345, the loop trims the ID character by character (1234, 123, 12, 1) and finds that 1234 already exists, triggering the conflict error.
Why This Validation Exists
This validation is in place to prevent reporting issues with the subproject hierarchy. Large portions of the project module codebase use SQL LIKE commands to select related records. The subproject ID is expected to include the parent project ID as a prefix. In the example above, project 12345 would be incorrectly interpreted as a subproject of 1234.
Removing this validation when using manual number sequences may appear to resolve the immediate issue, but it can introduce data integrity and reporting problems across the project module wherever parent-child project relationships are queried using pattern matching.
Resolution Options
- Design your numbering scheme to avoid project IDs that are substrings of each other. For example, use fixed-length IDs with leading zeros or include separators (e.g.
PROJ-1234,PROJ-12345). - If the number sequence is set to continuous (automatic), update the next number in the number sequence configuration to a value beyond any manually created IDs.
- Removing the while loop validation is possible via customisation for manual number sequences, but should be done with caution and thorough testing of subproject reporting and any
LIKE-based queries in the project module.
Source: Project number conflicts with project number ###### – Dynamics 365 Community Forum