+ Start a Discussion
JaguarJaguar 

Javascript Error - identifier starts immediately after numeric literal

I have a Custom Button 'New Vehicle' for a Custom Object which is a related list of Case.
This has a Javascript

window.open("/apex/CaseVehicles2?id="+{!Case.Id}  + ,'_blank','toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=1200, height=600, location=no, titlebar=no, menubar=no');

And for the life of me,  will not work and give me the error "identifier starts immediately after numeric literal".

Strangely enough, when I change merge field to a CaseNumber --  {!Case.CaseNumber}  it works fine.  But Case.id will not work

Am I missing something obvious ? 

Thanks



Best Answer chosen by Jaguar
Chidambar ReddyChidambar Reddy
Hi 

Here the identifier is ','

Try changing like below
window.open("/apex/CaseVehicles2?id={!Case.Id}" ,'_blank','toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=1200, height=600, location=no, titlebar=no, menubar=no');


Thank you
choose it as best answer if it resolved your issue.


All Answers

Chidambar ReddyChidambar Reddy
Hi 

Here the identifier is ','

Try changing like below
window.open("/apex/CaseVehicles2?id={!Case.Id}" ,'_blank','toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=1200, height=600, location=no, titlebar=no, menubar=no');


Thank you
choose it as best answer if it resolved your issue.


This was selected as the best answer
JaguarJaguar
Thanks Chidambar.  That worked

BTW my orginal script was wrong it should have been.  Irrespective, your solution worked.  Now sure why I did not think of what you did.

window.open("/apex/CaseVehicles2?id="+{!Case.Id}  + ,'_blank','toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=1200, height=600, location=no, titlebar=no, menubar=no');