Page 1 of 1

add "Last Modified" column to creditor contacts

PostPosted: Thu Mar 05, 2020 1:18 pm
by pricerc
I'm wanting to add a "Last Modified" column to the contacts grid in Creditors.

Adding the column is easy enough. But I can't figure out the trick to then populate it from the contacts when they're displayed?

Re: add "Last Modified" column to creditor contacts

PostPosted: Thu Mar 05, 2020 3:50 pm
by Mike.Sheen
pricerc wrote:I'm wanting to add a "Last Modified" column to the contacts grid in Creditors.

Adding the column is easy enough. But I can't figure out the trick to then populate it from the contacts when they're displayed?


You need to add handlers for all the cases where the grid is normally displayed (read end, contact name added, and so on). It's a bit of a pain but it's not that bad.

So, in your FormPlugin class Setup method, add handlers for:

  • creditorForm.Creditor.ReadEnd
  • creditorForm.Creditor.CopyEnd
  • Creditor.ContactNames.Added
  • creditorForm.Creditor.ContactNames.Changed

And in there you'll need to find which row in the grid you want using the column with a key of "Key" matching the RecID of the Contact Name, and then you can set the contents of your "Last Modified" cell.