It looks like what you are trying to accomplish is to return all child records for the specified Contact.Id. Just query on and return Donation__c records directly. If your lookup field has an API Name of Contact__c, your entire method body would look like:
return [SELECT Name, Email1__c FROM Donation__c WHERE Contact__c = :recordId];
Your type returned from a query is always defined by your FROM clause. You can sometimes assign to a singular object instead of a list when you know there is exactly one result. But the type would be the same. No other clause in your query matters. Only FROM.
Please note that the syntax for querying a parent field involves using the relationship name. For ...
Your trigger is on the wrong object. If you want to react to delete events on classic Notes and Attachments, you'd need two triggers on the relevant sObjects:
Attachment for classic Attachments
Note for classic Notes
If you're working with Lightning's Files and Enhanced Notes, you'd be looking at the rather more complex suite of ContentVersion, ...
What do you mean by cleaner way. The IF() can be pretty clean / easy to implement if you print it clearly.
IF(RecordType.Name = 'RT1', 'ABC',
IF(RecordType.Name = 'RT2', 'DEF',
IF(RecordType.Name = 'RT3', 'GHI',
in my opinion, this is pretty clean.
To answer your question, you can use the CASE function as well but this will only be as 'clean' as you ...
Yes, that is the standard behavior for Master-Detail relationships. The access to the detail record is determined by the access given for master.
You can either provide access to the master records to specific users (through Sharing Rules) or you can maintain the lookup relationship between the two objects like you had and adjust your report to fit your ...