I want to create a record with e.force:createRecord
. I want to create the default fields values in apex logically, then pass them back to the JS controller to be used in defaultfieldValue property as JSON. What's the best way to do this ? :
createWA : function(component,fields){
var createWA = $A.get('e.force:createRecord');
if(createWA){
var defualts = JSON.stringify(fields);
createWA.setParams({
"entityApiName":"Waste_Assessment__c",
"recordTypeId": fields['rectypeid'],
"defaultFieldValues":default
});
I'm creating the field list here in apex using a Map:
public static Map<String,String> init(String oppid){
Map<String,String> fields = new Map<String,String>();
this didn't work when the e.force:createRecord window appeared it said:
Looks like there's a problem.
Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details.