Hi,
I have created an entity called Event and it has relationship with Contact. I have an "entryCount" field to calculate the contacts linked/related to the event:
1. When a new contact is chosen to link/related to an event, the value of field "entryCount" of that event shall increase by 1.
2. When a linked/related contact is chosen to unlink/unrelated to an event, the value of field "entryCount" of that event shall decrease by 1.
Currently I can only do this by workflow but it has a time delay.
I know creating customized hook is the best solution to this but I can not find any example sources (and I am not a professional engineer either). So I would be more than thankful if anyone can help me with such hook codes.
Thanks in advance.
Chris
I have created an entity called Event and it has relationship with Contact. I have an "entryCount" field to calculate the contacts linked/related to the event:
1. When a new contact is chosen to link/related to an event, the value of field "entryCount" of that event shall increase by 1.
2. When a linked/related contact is chosen to unlink/unrelated to an event, the value of field "entryCount" of that event shall decrease by 1.
Currently I can only do this by workflow but it has a time delay.
I know creating customized hook is the best solution to this but I can not find any example sources (and I am not a professional engineer either). So I would be more than thankful if anyone can help me with such hook codes.
Thanks in advance.
Chris
Comment