+ Start a Discussion

Can I reference a parent record before inserted?

For example - would this work?

feedItem f=new feedItem();
//some code to assign required fields;
feedComment c=new feedComment();


insert f;
insert c;


Best Answer chosen by Admin (Salesforce Developers) 

Ok - I stopped being lazy - you cannot reference a parent before insert.  It isn't a pointer, but takes the actual value at the time of assignment.