How do we prevent un-necessary updates on a record?

How do we prevent un-necessary updates on a record? For example, a User(say A) is owner and creator of a record. There is a visualforce page which updates this record.

Can we prevent the Lastmodifieddate from being updated even though there aren't any changes to the record?

Please don't say that you have to query the record, compare the changes and then update the record.


OPTION 1 You can create a flag and init in FALSE, when A user change any value in the visualforce you can change the value of the flag. Before update the record you must verify the value of the flag, if is true you update the record.

OPTION 2 In the constructor of the visualforce you do a backup of the record. Before update the record you compare the backup with the original record.

If they are different then you can update the record


Category: apex Time: 2016-07-29 Views: 0
Tags: apex

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.217 (s). 12 q(s)