function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak Sharma 12Deepak Sharma 12 

expecting a semi-colon, found ':'

User-added image
Dear All here is my apex code along with error. Please provide solution as well about '&nbsp' in apex code.
 
Best Answer chosen by Deepak Sharma 12
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Not sure what you are trying to do but you must replace a=nbsp; to an alias like "acc" (without the double quotes):

i.e.:
for (Account acc: [select....

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.

All Answers

Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Not sure what you are trying to do but you must replace a=nbsp; to an alias like "acc" (without the double quotes):

i.e.:
for (Account acc: [select....

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
This was selected as the best answer
Deepak Sharma 12Deepak Sharma 12
Hi
Thank you for your solution.
Can you please tell me why we use &nbsp in apex code. As i am new to salesforce and just copied this from some blog.

Thanks in advance.
 
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello,

Coding in Apex you will never use it.   is the entity used to represent a non-breaking space. It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this   occupies.

You have copied because probably the page rendered it wrongly.

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.