You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to navigate from one component to another component on click button after Change Opportunity Stages (Mark Stage as Complete) in lightning component Salesforce
#46
Open
vijayk3327 opened this issue
Aug 20, 2023
· 0 comments
In this post we are going to learn If Opportunity Stages Change then check the StageName Value through Javascript after that navigate the lightning component by on click custom button in lightning Salesforce
Real time scenarios:- If Opportunity Stages (Mark Stage as Complete) then check the value and navigate from one component to another component on click button in Salesforce.
In this post we are going to learn If Opportunity Stages Change then check the StageName Value through Javascript after that navigate the lightning component by on click custom button in lightning Salesforce
Real time scenarios:- If Opportunity Stages (Mark Stage as Complete) then check the value and navigate from one component to another component on click button in Salesforce.
👉 To get source code live demo link, Click Here.
Create Lightning Component
Step 1:- Create Lightning Component : navigateStageCmp.cmp
`<aura:component controller="naviagateStageCtrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
lightning:card
</aura:component>`
Create JavaScript Controller
Step 2:- Create Lightning Component : navigateStageCmpController.js
`({
naviagateAction : function(component, event, helper) {
helper.naviagateStageHelper(component);
},
})`
Create JavaScript Helper
Step 3:- Create Lightning Component : navigateStageCmpHelper.js
`({
naviagateStageHelper : function(component, event, helper) {
var recordId = component.get("v.recordId");
})`
Create Apex Class Controller
Step 4:- Create Apex Class : naviagateStageCtrl.apxc
`public class naviagateStageCtrl {
@AuraEnabled
public static Opportunity getOppStage(String recId){
Opportunity oppObj = [SELECT Id, StageName FROM Opportunity WHERE Id=:recId];
//system.debug('oppObj ' + oppObj);
RETURN oppObj;
}`
👉 To get source code live demo link, Click Here.
The text was updated successfully, but these errors were encountered: