Hi All,
Im getting the following error when I'm handling NoMatch event in my voice element.
192.168.0.102.1466357802601.0.SprintCustomElements,06/19/2016 23:06:58.190,A VoiceXML error occurred of type "error.semantic": Error in eval(): Mfield=(noMatch);; nested exception is:
org.mozilla.javascript.EcmaError: ReferenceError: "noMatch" is not defined.
the below code throwing this error
NoMatchPrompt nomatch = new NoMatchPrompt(ved, nomatch_audio_group,"max_nomatch_count", getSubmitURL(), 1);
VEvent nmEvent= nomatch.getEvent();
nmEvent.addCount(1, VAction.getNew(pref, VAction.ASSIGN, vFName, "noMatch", VAction.WITHOUT_QUOTES ));
menufield.add(nmEvent);
VAction throwNomatch = VAction.getNew(pref,VAction.THROW ,VAction.NOMATCH );
can any one helps me what went wrong in my code?. Thank you
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Is this the line of code that is throwing the error?
VEvent nmEvent= nomatch.getEvent();
nmEvent.addCount(1, VAction.getNew(pref, VAction.ASSIGN, vFName, "noMatch", VAction.WITHOUT_QUOTES ));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi ewindgat , yes ,this peace actually throwing a nomatch event.
VAction throwNomatch = VAction.getNew(pref,VAction.THROW ,VAction.NOMATCH );
but the below code
VEvent nmEvent= nomatch.getEvent();
nmEvent.addCount(1, VAction.getNew(pref, VAction.ASSIGN, vFName, "noMatch", VAction.WITHOUT_QUOTES ));
cant handle the event thrown by throwNomatch action. If I kept this with "undefined" like below it is working.
nmEvent.addCount(1, VAction.getNew(pref, VAction.ASSIGN, vFName, "undefined", VAction.WITHOUT_QUOTES ));
As per my understanding ,
VAction.getNew(pref,VAction.THROW ,VAction.NOMATCH ); always throws undefined for whether it is noinput or nomatch.It did allow to assign a variable with some value , but the finally returning undefined. I don't know my understanding is right or wrong.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You might try using the VXML_LOG_VARIABLE_NAME then concatenating other values for your "noMatch" variable.
It might not be your variable "noMatch" that is undefined, but finding a match in the JS function.
You might start with your vFName.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think the question here is what's supposed to be assigned into the vFName variable in this line of code:
nmEvent.addCount(1, VAction.getNew(pref, VAction.ASSIGN, vFName, "noMatch", VAction.WITHOUT_QUOTES ));
If you're trying to assign the literal word 'noMatch' into your variable then you should change the VAction.WITHOUT_QUOTES to VAction.WITH_QUOTES
If you're trying to assign the contents of a variable named noMatch into the vFName, then you better ensure you've created and assigned a value to the noMatch variable, otherwise it'll cause this error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Oh I'll try this . and thank you very much for the help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.