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
Topher SympsonTopher Sympson 

On e.force:createRecord, can you set the defaultFieldValue for a lookup/Master-Detail field?

On an event I'm attempting to pre-fill a Master-Detail(Account) field on a new custom object record using the e.force:createRecord method.. Is this possible?

I've tried putting in the ID of the account record, the text.. that's it so far..
navigateToCreateRecord: function(beNum, stateInput) {
        let siteIdentifier = `${stateInput}${beNum} - `; 
		var navEvt = $A.get("e.force:createRecord");
        navEvt.setParams({
            "entityApiName": "Site__c",
			"defaultFieldValues": {
				'Name' : siteIdentifier,
				'BE__c' : beNum,
				'Shipping_State__c' : stateInput,

				// Below is field attemping to fill:
				'VNT__c' : 'VNT'				
			}
        });
        navEvt.fire();
    },
Thank you!