Example of attribute columns

You can formulate based on the formula’s cost and each ingredient’s contribution to the cost. Any Material Rollup parameter can be used in this case.

In this table, an attribute column is renamed Unit Cost and it holds each item’s Full Rollup parameter value. Another attribute column is renamed Extended Cost. The values for these fields are specified by the event hook scripts.

Original Column Renamed Column Value From
Attribute 1 Unit Cost Script to get Item parameter value
Attribute 2 Extended Cost Calculated by event script
Qty Qty Manual entry or calculated by event script

This table shows a summary of the events and scripts:

Event Script Response
Display formula ingredients [IngredPostLoad] Retrieve unit cost of each ingredient in the formula.
Edit item quantity [PostRowUpdate] Calculate Extended Cost = Unit Cost & Qty

For this example, specify $1.00 as the desired extended cost for an ingredient whose Unit Cost is $0.50 per kilogram. When moving out of the row, the script calculates the quantity needed to deliver this extended value or Qty = ($1 / $.5 per KG) = 2 KG.

In another example, the user specifies 3 KG into the Qty column where the Unit Cost is $0.25. The script calculates the Extended Cost as (3 x 0.25) = 0.75.