Where do you have this code? Method directive or Data Directive?
Also, You should be raising an exception if you are wanting to interrupt the current method from firing. Breaking from your custom code, will just stop the foreach block from continuing to process and continues on with the Epicor method.
throw new Exception("Tell them what you are preventing")
I am using changedetailpartnum but its still firing when the part exists. I am assuming that since this BO only gets used when adding a new line to a PO that there is only one part to check if it exists in the db already.