Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

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 .

share|improve this answer
2  
I'd split it :) Put ISNEW() || ISCHANGED(BillingStreet)... in the condition and the formula can be simple IF(ISNULL(BillingUpdate__c),1, BillingUpdate__c + 1) (this to be on the safe side if default value is not 0). –  eyescream Dec 18 '12 at 6:39
    
Good point!I had made default value as 0. –  Mohith Shrivastava Dec 18 '12 at 6:57

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.

share|improve this answer

You can either use work flow or trigger for this purpose

share|improve this answer
3  
And how such answer can help Mani, an example would be a nice addition ;) –  eyescream Dec 18 '12 at 6:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.