question on javascript remoting function from Skuid

  • 1
  • Question
  • Updated 2 years ago
Hi,

I have a scenario like mentioned below:

A function to call APEX from skuid snippet, which takes a parameter "userType".
If the event is not successful and on some specific error code., would like to modify that parameter to "some other" and need to call this function again.

myController.myApexFunction(userType,function(result,event){

  if(event.status){
        //already some happening code
        //I am good here to do something
    }
else if(event.status === false && result.errCode === 'user exists'){
    //need to modify param
    userType = 'existing';
  //call this apex method again
 //here instead of pasting the function call "myController.myApexFunction(userType,function(r,e){})" , I thought of using http://summerofgoto.com/js/goto.js , to move the control to the line above where the apex function call starts.

}

});
 

Has anyone tried using goto.js used from Skuid ?

When I tried to include this as an external script on  my page, and tried to create a label as suggested in goto.js documentation (http://summerofgoto.com/ )

I got the error on label creation line as shown below:



I know why this is due to the type of script has to be mentioned like "text/jsplusgoto" as used in below sample html page code:

<html>
<head>
<script src="http://summerofgoto.com/js/parseScripts.js"></script>;
<script src="http://summerofgoto.com/js/goto.min.js"></script>;
<script type="text/jsplusgoto">

var i = 0;
[lbl] start:
console.log("Hello, world!");
i++;
if(i < 10) goto start;

</script>
</head>
</html>

now, the Question here is : how could I let the SKUID - Snippet know that it would be aware of the label creation in this case ?
or in simple words - how to let the skuid snippet to be aware this is of type <script type="text/jsplusgoto">  ?


Any help is much appreciated!

Thanks in advance.

Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 2 years ago

  • 1

Be the first to post a reply!