+ Start a Discussion
Kolli SFDCKolli SFDC 

DML Update details in trigger or apex class

Need DML update details in trigger or apex.
if any field is updated? is there way to find that DML update happened from either manual or Data Loader or some other API.

Requirement:- If I update any field manually, do not want to update the same field from data loader or some other API.
GauravendraGauravendra
Hi Kolli,

I don't think there is a way to identify if the record is getting updated manually or using data loader.
Although, if you want to distinguish, you can create a checkbox on object. And update that checkbox to true apart from other update, when updating the record using data loader or other API. In that way, inside the trigger you can check if this checkbox is checked, that means its coming from data loader.

Hope this helps!
Kolli SFDCKolli SFDC
Thanks for suggestion Gauravendra. 
your suggestion will work for any field when we update the checkbox. but want check every field is updated manually or not  those are mentioned in the CSV file.