Skip to main content

Hello everyone!

 

What I’m trying to achieve:

On our Product Structure page, on the tab called Components, I would like to add two new columns called Unit Cost and Amount. Like the mock-up below:

 

 

I would like the new UnitCost column to be populated with the UnitCost value on the InventoryPartUnitCost entity. See below:

 

What I have tried:

I added the InventoryPartUnitCost entity to the ProductStructureHandling projection. In that projection, I created an Entity Association between the ProdStructure and the InventoryPartUnitCost entities. See below. I based my Entity Association on the Part Number of each entity matching.

 

I started to add a read-only Custom Attribute to the ProdStructure entity, as below:

However, I got stuck at the next screen because the InventoryPartUnitCost Entity is not listed as a Reference of the ProdStructure Entity. See below:

Obviously my approach is wrong. Please can somebody explain my mistake?

Thank you

Benjamin

I would use read-only two custom fields on entity ProdStructure in this case, which you configure in the Entity Configuration page. Adding associations to projections are for when you want to display additional lists and tabs. (For instance, you could make a nested list under each component line displaying the unit costs, but I don’t think that would help you.)

I tried following the reference path, but it wouldn’t let me, so you’ll probably have to resort to a select statement along the lines of:

SELECT inventory_value FROM Inventory_Part_Unit_Cost_Sum WHERE contract = :contract AND part_no = :component_part

 

(I haven’t actually tested it, but it validates.)

For total cost you’d have to pass in the quantity as well (v.qty_per_assembly) and multiply:

SELECT :qty_per_assembly * inventory_value FROM Inventory_Part_Unit_Cost_Sum WHERE contract = :contract AND part_no = :component_part

Thought that would fall apart if parts cost level is configuration, lot/batch or serial instead of just per part. It might be prudent to add:

 AND configuration_id = '*' AND lot_batch_no  '*' AND serial_no = '*'

 


Sorry for the delay getting back to you, AussieAnders, and thank you for this. It was helpful. I’ve followed your instructions and it looks successful to me, but I’ve asked my stakeholders for feedback.


Reply