You need to sign in to do that
Don't have an account?
Kiran Pandiyan
Why am I getting this error ?Please look at the Attachment and Description
This code is a sample code in Trailhead to be run on Anonymous window. I get below error always. I tried removing the space and retyping those words. But still I'm getting this error in same or someother line. Let me know a solution for this problem.
"Error: Compile Error: Invalid identifier ' BillingCity'. Apex identifiers must start with an ASCII letter (a-z or A-Z) followed by any number of ASCII letters (a-z or A-Z), digits (0 - 9), '$', '_', or unicode characters from U+0080 to U+FFFE. at line 5 column 1"
Your code looks good and I copy your code and ran it in my developer org's anonymous window.I did not get any error.Probably the code is getting any invisible character for you while copy-paste ,so it is giving the error.I will sugget you to delete the previous code and copy the code again from here and run it in anonymous window.Check if that works.
All Answers
Can you show me your program
This is the exact cod, I copy pasted. Thanks
if you need to run it on Anonymous window. then don't use apex class
1-open your developer console
2-use control+e to open Anonymous window
3-then paste your code
enjoy---
if you have any question then give a comment
please select as best answer if this is helpful
Thank you
Avaneesh Singh
Your code looks good and I copy your code and ran it in my developer org's anonymous window.I did not get any error.Probably the code is getting any invisible character for you while copy-paste ,so it is giving the error.I will sugget you to delete the previous code and copy the code again from here and run it in anonymous window.Check if that works.
Hi first time I tried just copy pasting and I got this error.
The above screenshot is second time, I removed the space in first line and I ran. It keeps shifting to next line as I remove space fro each line.
If i am right than it is formatting error. don't copy paste your code and type your code in annonymos window and hit execute button .
i don't think there is any problem in your code
Thank you
Avaneesh Singh
it work's fine in my org don't copy paste try to write your code and then hit excute window . it will work fine don't forget to chose best answer
Thank you
Avaneesh Singh