Using the method outlined here: https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/ref_force_createRecord.htm I can pop up a form to create a related object from my lightning component doing something like:
createRecord : function (component, event, helper) {
var createContactEvent = $A.get("e.force:createRecord");
createContactEvent.setParams({
"entityApiName": "Contact",
"defaultFieldValues": {
'RelatedWhatever__c' : '003f200002QgTorAAF'
}
});
createAcountContactEvent.fire();
}
Is there something analogous to defaultFieldValues when using the new lightning:navigation? I have the following code that will pop up the create contact form but there is no way to default my related property:
createRecord: function(component, event, helper) {
var navService = component.find("navService");
var pageReference = {
type: 'standard__objectPage',
attributes: {
objectApiName: 'Contact',
actionName: 'new'
}
};
event.preventDefault();
navService.navigate(pageReference);
}