You need to sign in to do that
Don't have an account?
EvertonSzekeres
Update +1
Hi,
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 !
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 !
trigger AccountFieldIncrement on Account(before insert, before update)
{
for(Account a : trigger.new)
{
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;
}
}
}