Custom actions

Custom actions

Hi 


My problem is taking place in Report>Custom_Actions.

I would like to create a button which update a quantity. The button in the Purchase Report update a quantity in the Stock.


My script works on Success on Form Actions but not on Functions.


Here is my script

fet=  STOCK  [ID == input.Add_Product.REF1];
fet.Quantity = (fet.Quantity  +  input.Add_Product.Quantity);


Error at line number : 3 
Variable Add_Product does not exist in PURCHASE

Why something which works on Sucess can not work on Function?