I would like to create a custom event on the Order Quotation that triggers when the user attempts to release the quotation.
Condition for the Event Action:
NEW:ROWSTATE = Released
I have created a custom field on the Order Quotation that is a calculation to display the margin percentage.
On clicking Release the event needs to check to see if this field is below a certain number. If it is below the defined number then a message needs to pop up informing the user that they cannot release the order due to the margin percentage being too low.
I have tried creating a custom attribute on the custom event that uses an api call to retrieve the custom field value:
ifsapp.order_quotation_cfp.get_cf$_margin_percent(&NEW:QUOTATION_NO)
And in the Event Action tried something like:
BEGIN
IF '&MARGIN_PERCENT' < '30' THEN
Error_SYS.Record_General('OrderQuotation', 'CHECKMARGIN: *ERR* The Sales Quotation Margin % is less than 40%.' );
END IF;
END;
However, I keep receiving:
table IFSAPP.ORDER_QUOTATION_TAB is mutating, trigger/function may not see it
Failed executing statement (ORA-04091: table IFSAPP.ORDER_QUOTATION_TAB is mutating, trigger/function may not see it
Any ideas/advice would be much appreciated.