You need to sign in to do that
Don't have an account?
steve456
Auto Events Creation-----Very Urgent
Whenever a custom object record is created an event is created on the calendar
Custom Object Name is Building
Here is the trigger
trigger AutoEvent on Building__c(before insert) { List<Event> lstNewEvents = new List<Event>(); for (Building__c bul : Trigger.new) { Event e = new Event(); e.StartDateTime = bul.Start_Date__c; e.EndDateTime = bul.End_Date__c; e.Subject = bul.Building_Event_Type__c; e.Phone__c=eve.Phone__c; e.Email__c=eve.Email__c; e.WhatId=------------------;I want this to be to given to the building name .How can i e.WhoId = ------------; Whom should i refer to can i give it to the owner lstNewEvents.add(e); } } insert lstNewEvents; } |
Is there any possibility that is event on calendar can be created to multiple invitees at the same time
Hi,
In case you wish to add Multiple Attendees (Invitees), use the EventAttendee standard object. You can add mulitple event attendees to one event. For the What Id, Use the Building Id (which will not be available in a Before Trigger)
Hope this Helps
Regards,
Ritika
Yeah, you definitely need to change this to an after insert trigger.
It is not possible to create multy attendee events from apex!!
http://success.salesforce.com/ideaView?id=08730000000BrDkAAK
Please vote for this feature if this should be become standard!
Cheers,
--dirk
why is it not possible
i would repeat the for loop for specific persons i want,....
Can you explan with more clarity
Would mean you can loop over the person account records - but how you will assign the records to only one event when the attendee record is not creatable, you can only have one whatid and whoid and you can not create a junction obj with a lookup to tasks/activities?! ;-)
Cheers,
--dirk
I would created 5 individual events to 5 different ppl with same data
When you click save
it would create events with same name and all info but is present on thier own calendars
All i doubt is how do i write a test method when it is read only
Do you know the person accounts to assign to when your object is created?! If yes than just create some records of your custom object within your test methd - the trigger will generate the events and than just query for the events and count them - now compare the count to the expected size and assert! Done!
Cheers,
--dirk
you told event attendee obj is read only right
The attendee obj is only used when you create one event record and assign that record to more than one attendees! This is only possible by usind the standard ui! So you have no access to this via api!
Would mean with your approach you can just write your test classes and deploy it!
In case all works pls mark the thread as solved!
Thx and good luck!
--dirk
Fingers crossed....i donno yet..i am wrkng if it would thn deal done