You need to sign in to do that
Don't have an account?
RichardR1
How to avoid saving other records in a custom VF page
Hello everyone, I created a custom list of Event records using a custom controller and Visualforce page. In the list the user can edit an Event but after saving the change, it also changes the last modified date of the other records on the list, even though there was no change to the data. What can I do so that Salesforce will only update the record that was changed?
Below is my current custom controller:
Below is my current custom controller:
public class EventsMDHomePage{ public List<Event> eventsToday {get; set;} public EventsMDHomePage() { eventsToday = [ SELECT FIELDS(STANDARD) FROM Event WHERE OwnerId =: UserInfo.getUserId() AND ActivityDate =: date.today() ORDER BY StartDateTime ASC LIMIT 1000]; } public PageReference saveEvents() { try{ update eventsToday; } catch(DmlException ex){ ApexPages.addMessages(ex); } return null; } }
Hope you query is answered below.
https://salesforce.stackexchange.com/questions/382812/how-to-avoid-saving-other-records-in-a-custom-vf-page
Thanks,