Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- General Development
- :
- Problem with Formula Field
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2013 07:42 AM
We have a field called Status, that is a picklist, i.e. New, Hold, Assigned, Completed. We have cooresponding date/time fields (formula), called new_date, hold_date, assigned_date, completed_date. What we need is when the status changes, to set each of the date/time fields with the exact time that it changed. So if the status is set to new, the new_date field would be set to NOW. If the status changes to Hold, the hold_date field gets set to NOW, but the new_date field is left alone.
IF(ISPICKVAL(Status__c ,"Hold"),NOW(),NULL)
Is the code that support provided, but what happens here is that when the status changes, the value gets Nulled out, not a good thing. What could we replace NULL with so that when the status changes to something other than what is defined in the formula, it does not reset the field?
Thanks.
Re: Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2013 08:30 AM
You can not use a formula field for this. The easiest way would be to use workflow rules and field updates.
Basically the workflow rule would fire when the status field changes and then you could potentially use the formula that you have to actually update the field instead of using a formula field.
Re: Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2013 08:52 AM
Re: Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2013 08:55 AM
I've gone down the JS sidebar route before, what I find tends to happen is that when you start adding functionality this way it becomes easy to keep adding functionality this way which results in a ton of JS running on every page load even the ones where it is not really doing anything, it still has to check to see if it should do something and can even slow down the overall speed of SF. As a result, I tend to do this as a last resort, but I do agree that it is a viable option in this instance.
Re: Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2013 08:59 AM
Re: Problem with Formula Field
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2013 08:06 AM
We used workflow rules and that is the way to go for this issue. Simple but effective.
Thanks all.

