Hello, I'm trying to get a return from this JavaScript
Inside the function it gets True, but outside or in the output variable for me to perform the logic it can't capture the value...
I've tried a few alternatives, but haven't succeeded yet
Can anyone tell me why? Thank youCode:window.onpopstate = function(event) {
$parameters.Test = true;
console.log($parameters.Test);
}; console.log($parameters.Test);
I managed to solve my problem with this code, with which I can't return to the page via the browser's back page
window.history.pushState(null, "", window.location.href);
window.onpopstate = function(event) {
var tl = document.title;
document.title="";
document.title= tl;
};https://www.outsystems.com/forums/discussion/68440/disable-browser-back-button/Shrinjala Singh´s comment
To achieve this, you'll want to set up a callback mechanism, which involves calling a screen action from within your JavaScript code. For example, instead of just logging the `$parameters.Test` value with `console.log($parameters.Test);`, you would instead invoke `$actions.YourScreenAction(value)`. This action call triggers the execution of `YourScreenAction`, allowing you to handle operations based on the input value within that specific action.
Hello, I tried to do as you explained, but it didn't work...
I created a client action and called it in JavaScript to be able to manipulate it inside, but it didn't work... If you can give more details...
I have noticed that when we invoke a screen action inside the onpopstate callback error is
"Invalid call of the 'BackButtonAction' client action of the 'MainFlow.Screen1' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action. "
So looks like it is not possible to invoke screen action in this particular scenario :(