You need to sign in to do that
Don't have an account?
Strange error opportunity Id does not exist in Sandbox
Could anyone help me on this, I am getting very strange error in the Sandbox.
For example if I am trying to write below code an error appears Variable does not exist :Id
trigger demo on Opportunity (after insert) {
List<Id> oppIds = new List<Id>();
for(Opportunity opp : Trigger.new){
oppIds.add(opp.Id);
}
}
I don't understand why this strange error is coming that Id does not exist.
Id is a standard field of opportunity, could any one help me to resolve this issue or anyone knows why this error is coming.
It will be really appreciated. Thanks !!
Regards,
Rajiv Roy
Rajiv, Ensure your org is not having any class with Name as Opportunity. If so, delete/rename it and try again.
All Answers
One suggestion:
I believe that you have more code below this, if you keep having problems, it is better to quote the exact error message.
Hope this helps,
regards
Thanks for the reply Sealva. Actually I have written only this portion of code and tried to save the code but got this error that "Id" does not exist.
I have updated the code, it should work, at least it was saved on one of my sandbox.
Let me know what happens
Rajiv, Ensure your org is not having any class with Name as Opportunity. If so, delete/rename it and try again.
Thank you so much!! It's resolved now. Thanks a lot!!