0

I know there's an identical question but the way it was solved worked for me at first but know almost a month later the error came back even though the field is still removed from the defaultFieldValues

Again I removed the Stage field which was the one giving me the problem, test it out and worked fine that day, a month later a user had to use it again and now is failing exactly the same even though the field is not there.

Original Code:

 if(createRecordEvent){ //checking if the event is supported
        if(recordTypeId){//if recordTypeId is supplied, then set recordTypeId parameter
            createRecordEvent.setParams({
                "entityApiName": entityApiName,
                "recordTypeId": recordTypeId,
                "defaultFieldValues": {
                    "AccountId": component.get("v.recordId"),  
                    "Stage": "Posted",
                    "CloseDate" :today,
                    "Name": component.get("v.acc.Name") + ' - '+ today  
                }
            });

How it is now but failing again:

 if(createRecordEvent){ //checking if the event is supported
        if(recordTypeId){//if recordTypeId is supplied, then set recordTypeId parameter
            createRecordEvent.setParams({
                "entityApiName": entityApiName,
                "recordTypeId": recordTypeId,
                "defaultFieldValues": {
                    "AccountId": component.get("v.recordId"),  
                    "CloseDate" :today,
                    "Name": component.get("v.acc.Name") + ' - '+ today  
                }
            });

Please I need help in fixing this

  • If this is an Opportunity, then the API name is StageName, not Stage – cropredy Nov 15 '19 at 1:52
0

Thanks cropredy, that is correct, I did also try with that however my actual mistake was that I was looking at the wrong code, since the error message was the same as the last time the client told me but it was actually being called from a different object so the solution was to remove it from the line like the first time is just I was looking at the wrong Helper this time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.