Where am I going wrong? I am trying to make defaultFieldValues dynamic by adding a variable.
When I try this code, the fields do not default:
var strNewPhone ="{ 'Phone': '999-999-9999'}";
var createAcountContactEvent = $A.get("e.force:createRecord");
createAcountContactEvent.setParams({
"entityApiName": "Contact",
"recordTypeId" : selectedRID,
"defaultFieldValues" : strNewPhone
});
when I try the below snippet, it works:
var createAcountContactEvent = $A.get("e.force:createRecord");
createAcountContactEvent.setParams({
"entityApiName": "Contact",
"recordTypeId" : selectedRID,
"defaultFieldValues" : {
'Phone' : '999-999-9999'
}
});