You need to sign in to do that
Don't have an account?

Apex code issue
Hi, Account and 'Private_Account_Information have look-up relationship. I want to copy PrivateAccount Information notes to Account notes. PrivateAccount Information have account_name field on it.
List<Notes_List> Noteslist = new List<Notes_List>();
List<Note> memberList = new List<Note>([SELECT Body,CreatedById,CreatedDate,Id,IsDeleted,IsPrivate,LastModifiedById,LastModifiedDate,OwnerId,ParentId,SystemModstamp,Title FROM Note where parent.type='Private_Account_Information__c']); // getting all the notes
for(Note source : memberList )
{
Note destination = new Note();
destination.body = source.body;
destination.ParentId ='001V000000HaOui'; // How to assign private account information.Account name here ??
destination.IsDeleted = source.IsDeleted;
destination.Title = source.title;
destination.IsPrivate = source.IsPrivate;
destination.OwnerId = source.OwnerId;
Noteslist.add(destination);
}
}
insert Noteslist; // inserting new notes
List<Notes_List> Noteslist = new List<Notes_List>();
List<Note> memberList = new List<Note>([SELECT Body,CreatedById,CreatedDate,Id,IsDeleted,IsPrivate,LastModifiedById,LastModifiedDate,OwnerId,ParentId,SystemModstamp,Title FROM Note where parent.type='Private_Account_Information__c']); // getting all the notes
for(Note source : memberList )
{
Note destination = new Note();
destination.body = source.body;
destination.ParentId ='001V000000HaOui'; // How to assign private account information.Account name here ??
destination.IsDeleted = source.IsDeleted;
destination.Title = source.title;
destination.IsPrivate = source.IsPrivate;
destination.OwnerId = source.OwnerId;
Noteslist.add(destination);
}
}
insert Noteslist; // inserting new notes
I am not pretty clear about your problem. This is what my suggestion from the understanding your problem.
Thanks
Sid