You need to sign in to do that
Don't have an account?
Jessica Clark 12
Inserting Record with Apex controller
Having one heck of a time trying to figure out why this isn't working. The array I have returns null, which I find really strange. Additionally, the related contact is not being created, but everywhere I look for information shows this as the correct way to insert a record. Am I missing something? Thanks in advance!
@AuraEnabled public static string[] insertRelatedContact(string oppId, string agentId ){ string[] infoArray = new string[] {oppId,agentId}; //INSERT RELATED CONTACT Related_Contact__c rc = new Related_Contact__c(); rc.OpportunityId__c = oppId; rc.ContactId__c = agentId; rc.Role__c = 'Assigned Agent'; insert rc; return infoArray; }
All Answers
And here is a screenshot of the return value returning null:
Could you post the javascript controller lhere, as well as any other relevant code.
Javascript Controller (bigger picture)