Hello all,
I'm getting an "accessor unknown" error in LiveCycle, and I can't figure out why. The error I'm getting is, "Error: accessor 'end_disposition_string' is unknown." As far as I can tell, this is generally caused by referencing a variable that hasn't been created, but I am creating "end_disposition_string" before I reference it. The error is in the object I'm showing the code for below, and I checked to make sure I have the language set to FormCalc.
Any idea what I could be doing wrong?
Thanks in advance for your help!
Solved! Go to Solution.
Views
Replies
Total Likes
Best practice is to declare your variables at the beginning of the script. You can include a comment line before hand like "//variables", but anyone reading your code should already know what you're doing there.
Views
Replies
Total Likes
It looks like a scope issue. You declared the variable end_disposition_string inside your if statement. Are you using that variable anywhere outside of that if statement? If you are, then that variable is out of scope, and you'll get that error message. Here's a short example of what I mean:
if (At($.rawValue,"ab" == 0)) then; This just gets us into the if statement
var s = At ($,"cd") ; Here, I'm declaring 's'
endif ;Once I 'endif', any declared variable inside is discarded
TextField2.rawValue = s ;Now, when I try to set the value of TextField2, there is no 's'
I don't know for certain if that is your problem since you didn't include all of the code, but that's where I'd start looking. Is there more code for that object? What is the line number that is provided when the system throws that error?
Thank you! That makes sense and is probably what I'm doing wrong. I do use the variable outside of the "if" loop. Unfortunately, I can't include the rest of the code, and the error message doesn't tell me which line the problem is on (it gives me "..." for the location). Is there any way to make a variable stick outside of the if statement?
Views
Replies
Total Likes
Best practice is to declare your variables at the beginning of the script. You can include a comment line before hand like "//variables", but anyone reading your code should already know what you're doing there.
Views
Replies
Total Likes
Thank you, thank you, thank you! That should have been obvious, but it wasn't. My issue is resolved. Really appreciate the help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies