• 23
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi all - just got back from the DEV 501 course and wrote my first VF page and custom controller from scratch!  Now looking to tweak certain things.

 

Is there a function to tell if the user has made a change to a value on a VF page?  In the UI, we have the function isChanged, and in Apex, we have Trigger.old and Trigger. new - but what about in a VF page?

 

If the context matters, here's the project:

Page containing a form that lists multiple sObjects by rows.  Two of the columns contain inputFields so the user can change multiple values all from one page, then hit Submit.  I use a SOQL query to put the sObjects into a List in the controller - then when the user hits Submit, I call update on that List.  Perhaps there's a better way to architect this?

 

Anyway - my concern is that all the sObjects are updated, whether or not they were changed (therefore the Last Modified Date and By are updated).  Thought I could build a 'changed' List out of ONLY those that were changed and just update that, but can't figure out how to tell what has changed.

 

Thanks for any help you can give...

  • July 28, 2010
  • Like
  • 1