You need to sign in to do that
Don't have an account?
when button pressed, redirect to a specific report in salesforce (NOT with direct URL)
Hi everyone,
I have a procedure that creates some data from a aura component page. This component uses a form and a submit button. This button (submitRecord function below) creates the data and then i navigate to a custom report to view that data. I need a way so when i press that button and the records get created, then to be redirected to this custom report page directrly. I used this : window.location.href = 'link_of_custom_report' and it worked. Instead i need to relocate dynamicaly and not with a direct link. Is there a way to do so? Thanks in advance!
controller:
({
submitRecord : function(component, event, helper) {
var action = component.get("c.createSummaryRecordsFromSpecicDates");
action.setParams({"setDateFrom" : component.get("v.startDate"),
"setDateTo" : component.get("v.endDate")
});
action.setCallback(this, function(result){
var state = result.getState();
if (component.isValid() && state === "SUCCESS"){
********** i need something here in order to redirect to my reports page **********
}
});
$A.enqueueAction(action);
}
})
Greetings!
You can use lightning:navigation component to direct to the particular record or page according to your requirement.Please find the example in the below document:https://developer.salesforce.com/docs/component-library/bundle/lightning:navigation/documentation
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri