Trigger on purchase receipt

Mokash

Member
Dear all,
The po receipt program is customized. while receiving it checks if standard cost is zero or not ,if standard cost is zero then it prompts message that "Standard cost for the item is zero" and ideally it should not create any receiver for that. As expected the program it is showing error message . But if we press F4 it creates entry in prh_hist , but it works fine for enter & F1 . Becase there is a command stop just after message is executed by pressing F1 or enter. Due to this program works fine. But if we press F4 system does not execute that command hence program fails.
Kindly help on the same. Please.......

The program structure look like:

on write of prh_hist:
------
-----
if ----- then
do:
message "error: standard cost is zero" .
pause.
bell.
stop.
end. /* end of if */

end. /* end for on write of prh_hist */
 
What you are trying to do is dangerous & not advised, playing with triggers and MFG/PRO will end up with spurious records as its not relational database.

How is the item active with zero cost? How is PO authorised with zero cost?

Still if you want to do this restriction do it at PO stage @ pod_det level.

This way any mess will be restricted to PO cycle unlike receipt stage whole po-gl cycle is affected.
 
Back
Top