I want to increment the value of custom field called BillingUpdate__c(number datatype) of Account object, whenever any value of the Billing Address of the Account object gets updated.
3 Answers
IF( OR( ISCHANGED (BillingCity),ISCHANGED ( BillingCountry ),ISCHANGED ( BillingState ),ISCHANGED ( BillingPostalCode) ,ISCHANGED (BillingStreet )) , BillingUpdate__c+1,BillingUpdate__c)
Use the above as the field value for the Update
1)Note the workflow you create must be every time the record is created or edited
2)Use the criteria such that any one of the fields i have used in above formula is not null.(following best practice and not allowing this rule to simply run).
3)Please keep default value as 0 for the BillingUpdate__c field .
-
2I'd split it :) Put
ISNEW() || ISCHANGED(BillingStreet)...
in the condition and the formula can be simpleIF(ISNULL(BillingUpdate__c),1, BillingUpdate__c + 1)
(this to be on the safe side if default value is not 0). Commented Dec 18, 2012 at 6:39 -
Create a workflow rule on Accout object that gets triggered when Billing Address is updated. Associate a field update with this workflow rule which will set the custom field value to whatever you want it to be.
You can either use work flow or trigger for this purpose
-
3And how such answer can help Mani, an example would be a nice addition ;) Commented Dec 18, 2012 at 6:36