- Have you ever had a scenario where you're overriding a standard button, such as the "New" button on an Opportunity, with an Aura component that invokes a screen Flow and passes the ID of the record type selected by the user, captured through the v.PageReference from the standard record type selection? I'm facing an issue where, when a user has only one record type available, there is no page reference to capture it from. It returns an error because the recordTypeId variable is null when the flow is initiated.
- My first idea is to get it from an ApexClass, do you have any other suggestion?
- This same component, when initiated multiple times without refreshing the page (there is a closing button so it's intended capability), retains its variables. Consequently, the recordTypeId remains the same, causing our Flow not to follow its correct path within the decision node.
- For this we have tried the window.location.reload() strategy to refresh the page;
- Also setting the inputVariables as null again inside the closing function mentioned didn't work.
3 个回答
@Ali Khan Firstly, thank you for your response.
As described in the post, we tried using window.location.reload(), but it didn't manage to close and reload the page as intended. Perhaps it is a code structure problem that resulted in this behavior.
For the second point, we are already saving this variable. But as mentioned, it doesn't seem to be refreshing if we don't reload the page before a second execution. Our hypothesis is that this behavior is happening because our initiated Flow is not finishing properly.
We have defined a button to destroy/close the Aura's modal, but it does not react to the finishing state of the flow.