You need to sign in to do that
Don't have an account?
Liz Gibbons 16
unexpected token: '='
I've got a strange error. I grabbed the controller code from this blog post, but when I try to save it to my dev org, I get an error: unexpected token: '='. I can't seem to figure out why. Any help would be appreciated!
Here's the controller throwing the error:
The error is being thrown at this line:
Here's the controller throwing the error:
Public class ThumnailController { public String imageUrl {get; set;} ContentVersion[] cvs = [select id from contentversion where contentdocumentid= '0691a0000015c3v' and isLatest=true]; imageUrl ='/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=' + cvs[0].id; }
The error is being thrown at this line:
imageUrl ='/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=' + cvs[0].id;
All Answers
You cannot give imageUrl a value 'out in the open'.
Because of the get and set keywords there, I believe you cannot initialise the value on the same line as the declaration.
So, it has to be from within a method: either a constructor or some other method.