function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Angel ZAngel Z 

lightning component to populate EventWhoIds

Hi all,

I want to use e.force:createRecord to create an event and attach multiple contacts to it.
console.log(component.get("v.contactIds"));
        
        var createEvent = $A.get("e.force:createRecord");
			createEvent.setParams({
                "entityApiName": "Event",
                "defaultFieldValues": {
                    'WhatId' : component.get("v.recordId"),
                    'EventWhoIds' : component.get("v.contactIds")
                }
            });
            createEvent.fire();

It does not work. Any ideas?
Best Answer chosen by Angel Z
Angel ZAngel Z
https://success.salesforce.com/issues_view?title=whoid-is-null-in-before-insert-trigger-on-event-object-when-triggered-through-lightning&Id=a1p3A000000mCob

The contacts are added after the event has been created.