You need to sign in to do that
Don't have an account?
RichardR1
How to update a field of a related record of an item from a collection?
I have a list of custom object (Meeting Note)and I want to be able to edit a custom field (Firm Type) from another object (Net Prospect Score) that is indirectly related to the Meeting Note object. They both have a lookup field to Contact object. Below is my attempt at an Apex class that does not work. I was able to only display the custom field but the update method does not work.
public class MeetingNoteCtrlr{ public List<MeetingNote__c> meetingNotesOutstanding {get; set;} public MeetingNoteMDHomePageCtrlr() { meetingNotesOutstanding = [ SELECT FIELDS(STANDARD), Name__r.Net_Prospect_Score__r.Firm_Type__c FROM MeetingNote__c ORDER BY Meeting_Date__c DESC LIMIT 100]; } public PageReference saveMeetingNotes() { try{ update meetingNotesOutstanding; } catch(DmlException ex){ ApexPages.addMessages(ex); } return null; } }
MeetingNote__c object, Which field you need to update the Firm_Type__c value?
Can you share the the VF page code?
Thanks!!