function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Update +1


There's a way to update a number custom field always increasing one more.

I want this field updated always when someone change any field in my case.
So I will put an IF in LastModifiedBy when is updated.

Thanks !
Best Answer chosen by EvertonSzekeres
you can have a trigger do something like this : 
trigger AccountFieldIncrement on Account(before insert, before update)
       for(Account a :
              if(a.CustomField__c == null)
                      a.CustomField__c = 0;
             if(a.LastModifiedById == /* add your comparison here, dont hardcode an id, query it outside of the loop*/)
                    a.CustomField__c += 1;