A formula is an algorithm that derives its value from other fields, expressions, or values. Formulas can help you automatically calculate the value of a field based on other fields (from Salesforce doc). Formulas can be used in many areas of Salesforce other than just Formula Fields, such as ...

learn more… | top users | synonyms

0
votes
0answers
34 views

How to calculate Calculate max end date inTask Recurrence

I am creating a custom VF page for tasks. In the page one Recurrence field option is available. In this we can give the task a start date and end date. In the end date we can calculate max end date, ...
1
vote
2answers
45 views

Formula for calculating case age excluding weekends and holidays

I need to create a formula field or apex method for calculating case age (from CreatedDate to now) excluding weekends and holidays (as defined in the case's business hours). Is it possible with a ...
1
vote
1answer
23 views

Previous Month Formula

I'm trying to create a formula to check a box if the start date is last month. Not sure what is missing since it is checking the box for all records with a past month. OR( AND(/*Feb - ...
0
votes
1answer
28 views

Why is my workflow not firing? - “100 <> null” evaluates to false? null formula comparison issues?

Question In a workflow formula criteria, what's the expected behavior when comparing nulls with the <> operator? Details I've got a basic workflow that seems like it should fire but ...
0
votes
1answer
31 views

Creating a formula using a picklist and two checkboxes?

I'm looking to create a formula that returns different values depending on whether or not two boxes are checked, but only when a certain picklist value is selected. Meaning if a different picklist ...
0
votes
1answer
18 views

Duration as difference betweed to Datetime fields does not respect Seconds

It seems that Seconds are ignored in formula fields if you create the difference between Datetime/Time fields. Say you have two Datetime fields: End__c and Start__c Take a formula field Duration__c ...
2
votes
3answers
86 views

Loop through textboxes and ruturn one of them

I have three different text boxes(Email, Work Email, and Other Email) to enter email addresses. I created a custom field of type "Formula". I need it to loop through the three email(s) and return one ...
1
vote
1answer
52 views

VF Page Not Found issue with Managed Beta Package

When I am creating an Unmanaged Package and Test it in demo org - It works fine as I required, but when I create Managed Beta of the same package and Install it in Demo org and Test, It does not open ...
0
votes
2answers
28 views

I am having trouble with creating a number range IF formula

I want My formula to show Tier 0 if lifetime account Revenue is between 0 and 999, Tier 1 if Lifetime Account revenue is between 1000 and 10000 and so on. Here is the formula I have: IF ...
1
vote
1answer
23 views

Validation rule assistance

I'm looking for input on how to adjust an existing, working validation rule so that it doesn't fire when the running user is a specific Profile. Here is the existing rule: AND( ...
1
vote
1answer
23 views

Succinct Add Months Formula

Trying to do one but the characters involved mean that further calculations are impacted. Essentially, taking a date field, a months field, to get an end date field. DATE(year(SCD__c)+ ...
2
votes
1answer
47 views

Filtering query based on the value in Formula field

I am trying to filter a query based on a value in the formula field ,which is in hyperlink format .When i try quering the formula field based on its value its not returning any results.Is there any ...
3
votes
1answer
142 views

Formula Ninja to the rescue - Calculate Last Day date of period

In my CustomObject__c I define a time period by those 3 picklist fields: pkl_PeriodType__c { Year, Quarter, Month } pkl_Year__c { 2011, ...,2022 } pkl_Period__c { January, ..., December, Q1, Q2, Q3, ...
0
votes
2answers
32 views

Date & Picklist Fields with Record Type

I want to create a formula for a particular opportunity record type, comparing two date fields and returning one of two variations on a pick list. I've tried variations on the below formula but can't ...
0
votes
2answers
58 views

Access data in Visualforce/Formula fields through Custom Junction Object [duplicate]

I have three custom objects: Entity, Residency, and Address. Entity and Address have a many-to-many relationship; Residency is the junction object (two master-detail relationships.). Is it possible ...
0
votes
1answer
50 views

How to write formula based on pick-list value of the pick-list field

I would like to write a formula to count the number of days based on the conditions mentioned below.. If the Status__c (Picklist field) = Draft, calculate based on Now() - Last modifed date. If the ...
3
votes
1answer
152 views

How to use IF Statement in Formula field for checkbox

I want to copy data from one field in another if checkbox is true, I know I can do it by trigger but I want to do it in formula field, I don't know how to check the checkbox field my code is like this ...
3
votes
0answers
44 views

Can we conditionally render text in a non-Visualforce email template on a picklist?

I'm working on designing an HTML template as a possible workaround to a problem with Visualforce templates refusing to send when triggered from a workflow rule where the ownership changes, and the old ...
1
vote
1answer
19 views

Automatically generate Password using a given formula (Letter of First Name+ drop the zeroCIPSMemberNo+Firstletter of surname)

can anyone please assist me on formulating a correct formula for to automatically generate a password based on this given formula : (Letter of First Name+ drop the zeroCIPSMemberNo+Firstletter of ...
0
votes
2answers
20 views

BLANKVALUE in formula not working

I have a test that is failing and was previously working. I have two decimal fields on a custom object, let us call them Field1__c and Field2__c. I then have Field3__c with a formula. ...
1
vote
1answer
17 views

Having a field linkable like the object name

Basically, on the Account page, I've a related list called 'Rate', which has a field called 'Rate Group' You can click on Rate Group to go to the Rate Group page, but I was wondering if I could make ...
0
votes
2answers
30 views

How to freeze a record once stage value got funded

I have a following validation rule for "need to allow to create opportunities and be able to update opportunities as long as the deal stage is not funded. and do not allow them to change the stage to ...
1
vote
1answer
32 views

How do we calculate the average value of a field in a lookup relationship?

We have a lookup relationship between a meter (parent) and an index (child). We would like to calculate the average of all indexes, and then validate if the entered value of the index is not greater ...
2
votes
0answers
30 views

Is it possible for a popup window to appear after a validation rule returns false?

We need a validation rule to check if a entered value is not twice as large as the average of the last three years. If the validation rule returns false, there should be a popup window displaying the ...
2
votes
2answers
62 views

Calculate days between DateTime field and Now()

I am trying to create a formula in my custom report to show number of days between CUSTOM_FIELD (datetime field) and NOW(). How can I do this?
0
votes
1answer
38 views

How to use this formula in Reports?

I want to display a Case Created Hour,So I've a formula.I want to use this formula in Report. VALUE(MID(TEXT( CreatedDate ),12,2)) + ( DST_Offset__c ) Here DST_Offset__c and CreatedDate are ...
3
votes
2answers
136 views

How does the field type “Auto Number” calculate?

I'm looking for the formula used by Salesforce on Data Type: Auto Number fields. I assumed it was sequential (increases by 1 from the last number generated), but according to our data, it doesn't ...
1
vote
2answers
28 views

Fixing Websites

I made a formula field that takes the website and cuts off the beginning too make it easier to compare websites in reports. The one problem I ran into is if someone puts in a website as example.com ...
2
votes
1answer
37 views

Formula to set value on pick list based on user country

I have a question before using apex to accomplish this. On the Event page layout I'm using a couple of custom fields; Location_Country__c and Location__c. These fields have a field dependency, ...
0
votes
0answers
19 views

Referencing Website Field [duplicate]

I made a formula field that takes the website and cuts off the beginning too make it easier to compare websites in reports. The one problem I ran into is if someone puts in a website as example.com ...
2
votes
3answers
95 views

How to extract the time into a formula field?

I want to extract the time component of CreatedDate (standard field) into a formula field (which should be a string) that contains just the time part. So if CreatedDate is Jan 4, 2014 17:23:10, ...
1
vote
1answer
152 views

Formula to calculate time between two dates, Salesforce example broken

I'm aware the question "How do I calculate the time difference between two date/times?" has been asked a lot, and not just on here. After doing the recommended thing and looking on this page (right ...
2
votes
1answer
33 views

Complete Regex Reference For Salesforce Formulas?

Is there a complete Regex Reference somewhere for using REGEX() in formulas? I have searched and found nothing useful. The problem I am having is below. I want to know if any of the characters ...
1
vote
1answer
66 views

User-defined field dependent on values in picklists, formula needed

I am looking for a solution how to express a formula for an user-defined field with the following description: the formula should show the corresponding letter salutation dependent on the picklist ...
1
vote
1answer
20 views

SalesForce Report, to return contacts who have attended 3+ Campaigns

I really need some help Aim- Only show contacts where they have attended 3 or more campaigns. i have built the following report (see attached image) but i am stuck on how i can return contacts who ...
1
vote
4answers
115 views

Formula field is too big to execute (5,480 characters)

I got an error when i am trying to add fomrula in formula field. Error: Compiled formula is too big to execute (5,480 characters). Maximum size is 5,000 characters My formula is ...
0
votes
4answers
60 views

Validation Rule giving me a huge headache

Basically I need a validation rule to say IF field “HasOptedOutOfEmail” is unchecked, and mailing country = Canada, then field Canada_Email_Consent__c needs to be Updated. However the record ...
0
votes
1answer
52 views

Simple VR has me stumped :( Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1

This is probably one of the basic questions I will ever ask, but at the moment I am stumped and cant work out how to do it I need a validation rule to look at the field “Canada_Email_Consent__c” if ...
1
vote
2answers
37 views

Need to create a picklist formula …but the results needs to write to another field

I'm trying to create a formula using a pick list that will render the output of a revenue field based on the method of calculation(Method_of_Revenue_Calculation__c). Here is what I have. I keep ...
2
votes
2answers
61 views

How do I write a formula using a picklist and a date + value from picklist

I have a pick list that contains service level A, B, C. I need to create a formula that uses the service level from the pick and custom field (last review date) to populate field (Next review date) ...
0
votes
2answers
30 views

Can anyone help me with IF statement in formula?

I am trying to add another logical test to my formula. At the moment my formula checks the record type of an opportunity and generates a unique ID number in the formula field. The formula works fine, ...
1
vote
1answer
58 views

Using a workflow to update fields also effected by workflows

Afternoon all, I have two custom objects (Child & Parent), The Child is a questionnaire type that can be submitted to a customer (via email, its a visualforce page), they then approve it (when ...
2
votes
1answer
46 views

Date cannot be within x working days of today

I need a validation rule that checks the date of a field is not within 4 working days of today's date. Is it possible to do this, what would the formula look like?
1
vote
1answer
190 views

APEX Test Coverage Formula Field

I have a question on how to test a formula field from an APEX code coverage script. This is the scenario. There is a custom formula field, Activity_Total_Duration_Time__c, that it is part of my ...
1
vote
1answer
34 views

Basic Salesforce validation Rule formula

I need to create a validation rule to say if Mailingcountry = canada then field Canada_Email_Consent__c needs to be completed Canada_Email_Consent__c = Picklist Mailingcountry = text
2
votes
1answer
36 views

Why is it necessary to break date fields down before performing operations on them?

My introduction to programming was mainly .NET languages, so working with dates was usually a breeze, but one thing I've noticed on Salesforce is that (in the formula box at least) doing calculations ...
0
votes
0answers
14 views

Report to show # of closed cases with 1 casenote

We need a report showing the count of closed cases of an agent with only 1 casenote plus the total number of closed cases of the agent. Then we need a formula setup in the report like this: % = ...
2
votes
3answers
39 views

Using a collection in the CASE formula

I am trying to create a field that translates the values stored in another field. However, I run into a problem if the source holds different values that translate to the same destination value. For ...
0
votes
1answer
44 views

Possible to use a formula to change field used to choose a record on lookup dialogues for Products?

I have the need to change the field that is clicked on to specify a particular record on the Product lookup layout. I can create a custom page if need be but I am curious if there is a way to use the ...
0
votes
1answer
64 views

How do I use a formula field with #Error! value in a field update?

I have a formula field that is just at the compilation limit maximum, and cannot be expanded any more, formatted as such: FieldA__c/FieldB__c I would like to reference the value of this formula ...