You need to sign in to do that
Don't have an account?
Sumesh Chandran
update Opportunity record through apex controller class!
Hello All,
This is what I have got so far to update the Stage of an opportunity, unfortunately it doesn't work at all.
Helper.js
Thanks all!
This is what I have got so far to update the Stage of an opportunity, unfortunately it doesn't work at all.
Helper.js
updateOppStage : function(component, selectedButtonLabel, selectedRecordId) { var updateOppCall = component.get("c.updateOppStage"); console.log(selectedButtonLabel, selectedRecordId); updateOppCall.setParams( { oppId : selectedRecordId, oppStage : selectedButtonLabel } ); updateOppCall.setCallback(this, function(response) { var state = response.getState(); if (state === "SUCCESS") { var result = response.getReturnValue(); console.log(result); } }); $A.enqueueAction(updateOppCall); }Apex Class Controller
@AuraEnabled public static Opportunity updateOppStage(String oppId, String oppStage) { Opportunity opp = [Select Name, CloseDate, StageName, sumchans__OppOwner__c From Opportunity where Id:=oppId]; opp.StageName = oppStage; update opp; return opp; }Please advise !
Thanks all!
Best Answer chosen by Sumesh Chandran
Sumesh Chandran
Hey all I got it worked out, it was this part that I got it wrong:
The colon should have been on the other side.