You need to sign in to do that
Don't have an account?
Trigger to Count RelationId on Event
Hello,
I am looking to create a custom field that will update after event insert to count the number of RelationId's on each event. Help please!
I am looking to create a custom field that will update after event insert to count the number of RelationId's on each event. Help please!
I m not getting that what u mean by relation Id's here please elaborate ur problem so that we can help u in a more better way?
Thanks
Saket
What I understand is u want to make a field on Event and want to store number of contact associated with that particular event ?
If Yes -> Event is a child and Contact is a parent so maximum of 1 contact will be there for each event so I think it is not making any sense :) still u want to count this then u can make a formula field for it no need to wirte a trigger :D
if no -> Please make me clear the requirement :P
I m very Sorry I was unknown of this that this can be done :), I learned from u thanks
Oksana after doing some digging I wrote a trigger on Event pls find it below
Actually I should suppose to write this on EventRelation but Salesforce dosen't allow for this so I am hoping that u will add the invities from the Salesforce Event UI for ex see Image below
Please update me that this solution works for u or not ?
If u r seeking any problem or question then plss let me know?
Thanks
Saket Sharma
sharmasaket703@gmail.com
Please Let us know whether your problem is solved or not ?
Thanks
Saket Sharma
Please Let us know whether your problem is solved or not?
Thanks
Saket Sharma
When I added this trigger to my sandbox and tried creating an event with 3 invitees, I ended up getting this error -
Apex trigger EventCountInvitee caused an unexpected exception, contact your administrator: EventCountInvitee: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: ()