Dear Martin Drab,
Thank you for verifying that I cannot stop the standard method from running. I don't think that I posted the problem that I had very clearly in my first post. I'll try to clarify. I work for a tax company. I wont be writing the tax calculation, that is a very complex thing, with many special cases and exception. We already have a very extensive and accurate tax engine which my company consistently updates for all current tax laws/rules which businesses using ERPs such as D3fo want to integrate with.
What I am trying to accomplish is this, when a tax calculate call would be triggered in the ERP, I would gather the necessary information from the transaction (item, price, shipfrom address, shipTo address etc) and pass them as a JSON string to our adapter (already have this part built) which will take the string, create a request object, which then is sent to our tax engine. The response from that engine would take the same path back to the ERP. Once we are back in the ERP we will then use that tax information to populate the information that our client wants.
I have succeeded in sending a string (representing a mock object which I have not yet created) to our engine and received a tax. I did this using a pre-handler (now changed to a post handler) which sends the JSON String to our engine and returns the tax information as a string. The issue I was having before was that the original calculate method from the ERP still gets executed. We are in the early stages of integration and we are discussing possible design options. (We don't yet know which tables get modified due to this tax call. We still have some code to read through).
One possible solution, since I cant get that method to not execute, is to overwrite all the information that the original tax calc() made (which is why the pre-handler got changed to a post-handler). This brings up a performance issues, as we would alter tables 2x, and could bring up potential errors if two users are making a call at the same time.
A second solution would be to created our own table so that we don't have to overwrite. However, any method that pulls information from that tax table, we would have to alter to pull from our new table. This would lead to more and more code changes, so we are trying to avoid this option.
Thirdly, we could try to use overlaying, and comment out the tax calc method to do absolutely nothing. And it would just be a place holder so that we can execute our post-handler and not worry about making changes to the same table twice per calc() call. However, as I mentioned before, we also want to avoid overlaying if possible, in case our client has made changes to the same class, which could result in merge conflicts.