Your issue involves all three focus areas: BOM relationship validation, cost rollup analytics configuration, and data integrity after structural changes. Here’s a comprehensive solution:
BOM Relationship Validation:
First, fix the null source_id references. Run this AML query to identify all broken relationships:
<AML>
<Item type="Part BOM" action="get">
<source_id condition="is null"></source_id>
</Item>
</AML>
For each broken relationship, you need to update the source_id to point to the correct parent Part. If you have many relationships to fix, create a server method to batch update them:
var bomItem = inn.getItemByKeyedName("Part BOM", bomId);
bomItem.setProperty("source_id", parentPartId);
bomItem.apply();
Cost Rollup Analytics:
Verify your Cost Rollup Settings include Part BOM as a valid relationship type. Navigate to Administration > Cost Management > Cost Rollup Settings and ensure the relationship_type property includes your Part BOM type. If missing, add it and save.
Next, clear the analytics cache to force a fresh calculation:
- Stop the Aras Innovator server
- Clear the cache directory: /Innovator/Server/cache/
- Restart and rebuild the cost analytics index
Data Integrity After Structure Changes:
Implement a validation routine that runs after any BOM restructuring. Create a server event on Part BOM that validates:
- source_id is not null and points to valid Part
- related_id is not null and points to valid child Part
- Relationship is in appropriate lifecycle state (Released/Production for analytics)
- No circular references exist in the BOM hierarchy
Add this validation as an onBeforeAdd and onBeforeUpdate event. This prevents future analytics failures by catching data integrity issues at the point of creation.
For your immediate problem: fix the null source_id values, promote Preliminary relationships to Released state, clear the server cache, and rerun your cost rollup analytics. The report should process successfully once the relationship integrity is restored.
Consider also adding a scheduled workflow that periodically validates BOM relationship integrity and sends alerts if issues are detected. This provides early warning before analytics reports fail.