Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save the information on custom blocks
I know we can define custom blocks (not exactly how but I think it is in the docs). But can I register an event during the installation of one module, that handles a special save action when a record of another module (where the custom block is in) is saved? So basically catch the $_REQUEST global and pick out the fields from my custom block?
all events are global, they get called everytime the event happens.
that means that if you register an aftersave event, your handler will be called on ALL the saves in the application. that is why you normally "protect" your handler with something like:

if (module is my module)....

in this case your condition will check for both conditions:

if (module is the one that has the custom block and I have information to do something with my module)....
Nice! So in my case (I want to make a block in salesorders), I would check for the aftersave event, make sure it was a salesorder and as long as I use named, hidden input fields I can use the $_REQUEST global right? Only thing is, will I also have the CRM ID of the salesorder that just saved?
Yes, you have all the information of the record being saved and the $_REQUEST array. It is the parameter
Nice! This is perfect for what I have in mind.

Forum Jump:

Users browsing this thread: 1 Guest(s)