Should be able to use a script on the pre-write event of the SO_SalesOrderDetail table but you may or may not need to have it filtered for specific criteria, such as only for new lines being copied from a repeating order unless you want to update costs on every line on ever order whenever the line is modified.
There is an inherited method called GetItemCosts that you can pass the item code and warehouse code to, along with variables to hold four different costs which are returned into the variables. You can then use SetValue on the UnitCost column with whichever cost you want to use.

------------------------------
David Speck II
Tennessee Software Solutions
------------------------------