I'm trying to understand how plug ins work. Specifically how the Pipeline Stages work.
I created a very simply book Entity.
What I was trying to do was after a new record is added to the database I wanted the price of the book to be incremented by 10% GST.
I wanted this action to be carried out on the server side by a plugin.
From the online documentation I read that the new record would be available in the database during the PostOperation Stage of the Create Step.
Can someone confirm that this is correct ?
This is not what i found.
Regardless what code i used i kept getting the error in the plugin code that the record i was trying to update did not exist.
I removed all the code from my plugin and replaced it all with a single line of code
throw new Exception("just so we can debug");
As it states, i just wanted to kill the code from doing anything in the PostOperation stage so no changes are made to the record in the database..
After "save and close " of the new record the exception is thrown. I then confirmed via the App and the Entity table that NO new record was created.
Since by the time the PostOperation is called the new record should already safely exists in the entity table nothing i did in that event should affect it.
But the fact that the new record was NOT created says otherwise.
Can some explain why this is occurring.
And how would i update the record in the plugin when a users does a "Save" or Save close" on a new record
Regards
Erick