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 

How to prepopulate EventWhoIds in lightning component

Hi All,

I am trying create a lightning component which uses e.force:recordCreate and prepopulates a list of ContactIds in the EventWhoIds field.
 
console.log(component.get("v.contactIds"));
  	
    var contactRecords = component.get("v.contactIds");
        console.log("contactRecords: " + contactRecords);
        
        var createEvent = $A.get("e.force:createRecord");
			createEvent.setParams({
                "entityApiName": "Event",
                "defaultFieldValues": {   
                    'WhatId' : component.get("v.recordId"),
                    'EventWhoIds' : contactRecords
                }
            });
            createEvent.fire();

Here's a screenshot of the console log:

Console logHowever, the contact do not get prepopulated in the form.

Any ideas/suggestions would be greatly appreciated.

Thanks!