For error on arrival on flow screen if previous has been clicked - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Ben MarshallBen Marshall 

For error on arrival on flow screen if previous has been clicked

Hi, I get the following error on arrival at one specific screen in my flow if the Previous button as been clicked at any time before or after. If Previous is never clicked the flow works fine. No flow error email is sent and debug doesn't pick it up. The only option is to close the flow and start again

class java.lang.String cannot be cast to class java.lang.Boolean (java.lang.String and java.lang.Boolean are in module java.base of loader 'bootstrap')

I'm not running any custom components on this screen or the ones either side of it and I have tested removing all record updates and logic between the screens to see if that helped but with no luck. I suspect this is a bug with one of the SF flow components in use. Has anyone had similar and been able to get around it?
Best Answer chosen by Ben Marshall
Tom BassettTom Bassett
Sounds like you have the Toogle component on the flow screen. 

I've had this issue before and was able to resolve by removing the Toggle. 

I would however suggest writing the toggle value (Boolean) to a flow variable and then setting this as the default value is not set right now which is causing the flow to fall over when going to previous. 

All Answers

Tom BassettTom Bassett
Sounds like you have the Toogle component on the flow screen. 

I've had this issue before and was able to resolve by removing the Toggle. 

I would however suggest writing the toggle value (Boolean) to a flow variable and then setting this as the default value is not set right now which is causing the flow to fall over when going to previous. 
This was selected as the best answer
Ben MarshallBen Marshall
@tom Bassett Yes, it was the toggle components. I swapped them out for something else and the problem went. Thanks for the advice. Its a shame the toggles don't seem robust as they are a great UI