SugarCRM CE 5.5.0

Hi,

I am trying to add a campaign to an account when ever that account gets added to a campaign target list.

So I created a one to many relationship between accounts and campaigns. So I now have a campaigns subpanel under each account. (this is in case that account is part of several campaigns at once)

So now I need to have a hook that adds the campaign to the subpanel in accounts.

So when I create a target list consisting of accounts, I need it to add that campaign to the account (to the particular accounts 'campaigns' subpanel)

I am thinking it needs to be an 'after_save' hook, but I am not actually saving the target list when I add an account (unless it saves it automatically - not sure how that bit works)

Has anyone done this before orr knows how to do this? Any help would be appreciated...

Thanks