You need to sign in to do that
Don't have an account?
Abhijeet Purohit01
Problem in test class...
Am writing a test class... The need is to include a field of a object which is lookup to itself..... How can I include?
If the field was lookup to some other object then I would have written something like this:
field =instance.id;
How to include a field which is lookup to itself?
Pls help.....
Abhijeet
Account testAccount = new Account(name='Test Company Name');
insert testAccount;
Account testAccount2 = new Account(name='Test Company Name2',account__c = testAccount.Id);
insert testAccount2;
All Answers
Account testAccount = new Account(name='Test Company Name');
insert testAccount;
Account testAccount2 = new Account(name='Test Company Name2',account__c = testAccount.Id);
insert testAccount2;
BINGO!!! Thank you............