I currently have the lightning component which updates some of the fields on the Case record and also inserts the Case Comment and associates to the case where the fields are updated through the Apex Class like below

                record.OwnerId = 'xxxxxxxxxx';
                record.RecordTypeId = 'yyyyyyyyy';
                record.Status = 'Transferred';
                QueueName = 'XYZ Queue';
                 update record; 
                String commentBody = 'Passing to '+ QueueName +' for action.';
                CaseComment cc = new CaseComment(ParentId = record.Id,CommentBody = commentBody, IsPublished = false);
                insert cc;    

I want this to be done through the LDS and in the controller I am doing like

  handleSubmit: function(component, event, helper) {
    var fields = event.getParam('fields');
    fields.Status = 'Transferred';
    fields.OwnerId = 'xxxxxxxxxx';
    fields.RecordTypeId = 'yyyyyyyyy';

    var QueueName = 'XYZ Queue';       

   /// Not sure how to create a Case comment record and associate with the Case record

Can anyone please suggest me if we can create the other record and associate it with them. Any help is greatly appreciated


Your Answer

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

Browse other questions tagged or ask your own question.