I am building a generic component which can be used either on a record detail page or within a flow. If it's being used in a flow, I want the user to go Next when they click a button, and if being used on a detail page, I want the user to remain on the page.
Is it possible to handle these two scenarios?
I am using FlowNavigationNextEvent
to navigate my flow.
@api availableActions = [];
then checkthis.availableActions.includes('NEXT')
before firing the event. I didn't try, but I think that firingFlowNavigationNextEvent
event in a record page would have no consequences, so the user would remain on the page.