
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 11:56 AM
I've recently discovered several browser errors saying "'current' is not defined" in my chrome browser console. It looks like the cause is UI actions that contain both a client-side function and a server-side function. They use the gsftsubmit function which I think I have seen before on SNGuru and in the community. Although the code works fine, it results in a browser error since 'client' is checked on the UI action.
The reason this has become such an issue now is because I am trying to use automated test framework for the first time, where the test will fail if any client-side javascript errors are encountered. Has anyone else experienced this issue, or found a way around it? Are UI actions with client and server side code just bad practice?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 10:05 PM
The server side code causes an error when it's run as client side code. I ran into this same issue, and fixed it by wrapping the server code in a function.
runClientCode(){
//client side code
}
if(typeof window == 'undefined'){
runServerSideCode()
}
function runServerSideCode(){
current.update();
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 12:49 PM
Update: I moved the server-side code to a separate UI action and unchecked 'client' on that one, and just call the server-side one from the client-side one using gsftsubmit(). It seems to be working well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2018 10:05 PM
The server side code causes an error when it's run as client side code. I ran into this same issue, and fixed it by wrapping the server code in a function.
runClientCode(){
//client side code
}
if(typeof window == 'undefined'){
runServerSideCode()
}
function runServerSideCode(){
current.update();
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2018 09:32 PM
Sorry for late reply, but I was experiencing this again and this solution works! Thanks.