Jump to content

Hook on PageTable item save can't grab data from the page it belongs to because it's not added until modal close.


elabx
 Share

Recommended Posts

The title sums it up pretty much!

I have a page where I save clients information, and then I create an "assignment" where I can pick a sales person and send them an email (through a hook after page::save) about the clients and this assignments page help me keep track of which salespeople have worked with the client. 

The problem is, when saving through the hook, i look for the client info like this (to send within the email):

$pages->find('assignments=$page');

Where $page,  is the assignment being created.

Maybe I should hook onto a field save? Or save the page beforehand in the same hook? (though i think I don't have a reference from the parent document, within the pagetable add new modal)

EDIT: I have another issue now! When saving the clients page, which has the assignments pagetable field, it's triggering save() in the added pages, is there a way to avoid this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...