You need to sign in to do that
Don't have an account?
anusha edpuganti 2
I wrote apexclass for insert note into custom object, i am trying to save that it is showing Error: Compile Error: Variable does not exist: ParentId at line 163 column 19 .please help me any one, why it is occur
Error: Compile Error: Variable does not exist: ParentId at line 163 column 19
global with sharing class RelatedList{
@RemoteAction
global static String insert_Note_Row()
{
Note n = new Note();
try {
n.ParentId='a017F0000015hib';
n.Body='she is ok';
n.Title='New Note';
insert n;
} catch (DmlException e) {
}
return('insert note successfull');
}
}
global with sharing class RelatedList{
@RemoteAction
global static String insert_Note_Row()
{
Note n = new Note();
try {
n.ParentId='a017F0000015hib';
n.Body='she is ok';
n.Title='New Note';
insert n;
} catch (DmlException e) {
}
return('insert note successfull');
}
}
Then update you api version of the class, this will probably solve your problem.
FYI: Prent is ID of the object associated with the note.
On which object you are creating note. May the object does not support notes.
Still same error in developer console
Every Org has its own prefix for sObject except standard object. So we can't identify custom object by prefix.
I tested for Account and is working fine for me.
Or check below code in developer console.