I have read all of the existing Custom Event topics and don’t see anything that helps me with this. I believe it is a simple syntax issue but have tried everything I can think of, unsuccessfully.
I am trying to calculate the cost of overissued material for a shop order component at the time it is overissued. It is all working fine, including custom attributes until I try to add one of the custom attributes to a calculation:
The Attribute ‘Part Cost’ is calculating correctly and the Over_Cost attribute works until I add * Part_Cost (to multiply the result of Qty_Issued - Qty_required times the part cost).
When I add that Part Cost to the Over_Cost attribute, the event will no longer trigger. I have tried to specific Part_Cost in the calculation as Part_Cost and :Part_cost and &Part_Cost and “Part_Cost” and :NEW.Part_Cost and get varying errors with each.
Any syntax help is greatly appreciated. I love the Event/Event actions tool and the ability to add Custom Attributes. It lets me provide good info and actions for my internal customers.
Best answer by Charith Epitawatta
I haven’t tried this particular setup, but you most likely cannot use one custom attribute in another since the values need to be calculated real time. Instead of specifying PART_COST after ‘*’ operator, have you tried specifying the whole server method of PART_COST within parentheses? It would make the server method of OVER_COST extremely, long, but should work.
OVER_COST = (:NEW.QTY_ISSUED - :NEW.QTY_REQUIRED)*(CONT1APP.INVENTORY_PART_UNIT_COST_API.GET_INVENTORY_VALUE_BY_METHOD(<arguments>))
Hope this helps!