Hi @Cody M and @Rafael Araujo ,
ProjSalesItemReq works with project item requirements, which are represented internally as sales-order documents. Therefore, finding the corresponding record in SalesLine is expected. However, a persisted line with LineNum = 0 should still be investigated.
The CounterField = LineNum property only assigns numbering when a line is created through that particular form data source. It is not a database-level constraint. A record created through X++, an integration, a data entity, batch processing, or another form can bypass that form behavior.
I suggest the following:
-Reproduce the issue in a sandbox using the exact same item-requirement process.
-Confirm whether it also occurs in a current, supported application version without customizations.
-Review extensions, integrations, batch jobs, and event handlers that insert or copy SalesLine records. Pay particular attention to code using insert() or doInsert() without executing the standard sales-line initialization and line-number assignment logic.
-If the issue is reproducible, capture a trace of the operation and inspect the X++ call tree to identify where the record is inserted.
Even when its quantity or amount is zero, do not assume the line is harmless. Check for related inventory, project, packing-slip, invoice, and other downstream records before attempting remediation. Also, do not update or delete the record directly in SQL. Any correction should use a reviewed X++ data-fix script or be handled with Microsoft Support.