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

1
vote
1answer
15 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
14 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
1answer
13 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
25 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
103 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
27 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
22 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
2answers
37 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
32 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
21 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
33 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
18 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
3answers
61 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
57 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
31 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
28 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
50 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
18 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, ...
0
votes
1answer
32 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
27 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
74 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
23 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
35 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
12 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
30 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
35 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
45 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 ...
0
votes
1answer
48 views

Formula for calculating remaining days

I have two fields in an object, Total_Casual_Leaves__c (Formula) 15 is constant value for it. Days_Requested__c (Number) that is user input. Now i want to write a formula for Remaining_leaves__c ...
0
votes
0answers
51 views

Decimal places are not coming in Formula field(number) in html email template

I have a currency formula field field1__c which is again referenced in another formula field Field2__c(number). I have selected decimal place as 2.When I use this formula field in Field2__c decimal ...
2
votes
2answers
47 views

I am trying to create a formula to calculate the number of remaining full months left in the year from the closed date

Example:: If close date is not this year, amount this year = 0 If close date is this year, amount this year = Setup cost + (Monthly amount x number of whole months between the close date and the end ...
1
vote
1answer
58 views

how to calculate due date in business hours

I have found a formula that will calculate a due date based on business days using the following: CASE( MOD(Date_Assigned__c - DATE(1900, 1, 7), 7), 0, (Date_Assigned__c) + Estimated_Turnaround__c + ...
1
vote
1answer
34 views

how to get value of one field to another field?

I tried for below isssue but no luck. i have contact object and default description field in contact object. now i created another description1 textarea field in contact object. i want to get ...
0
votes
1answer
29 views

Accessing invited user with formula fuctions

I was wondering if there is a way to access the User information page to obtain the Country and Title from that page, for people that are invited to an Event. So, I created an Event and invited a ...
0
votes
2answers
57 views

Start Date and End Date in hours from Activity object

I'm trying to convert the Start Date and End Date, that are part of the standard SFDC Activity object, into hours. It looks like it is not possible to access these two fields (schema names ...
0
votes
2answers
50 views

round a value to .0 or .5

I'm looking for a way to round a value to .0 or to .5, so 1,34 would become 1.5, 1.22 would become 1.0, 1.63 would become 1.5, and 1.79 would become 2.0. Is there a function to accomplish ...
0
votes
2answers
54 views

Dynamic summary formula

I want to create a summary formula on a report that changes it's value based on the entered date from the filters. Imagine this, a formula that multiplies a value with the number of days, like: Value ...
1
vote
1answer
279 views

Copy One custom field value to another custom field for a custom object

As in the accounts edit page, I want to achieve the Copy Billing address to shipping address for a custom object. I know this can be done either WF or trigger but I want that to be dynamic and based ...
6
votes
1answer
176 views

Roll up Count of booleans

Is it possible to use a roll up or formula field to count the number of "true" or "false" values on a boolean field of a detail record? Example: Account <-Master-----Detail-> My_Object__c ...
3
votes
1answer
45 views

Simple Validation Formula

So I'm trying to write a formula, If Override__c is "Yes", then Country__c cannot be blank. This is what I thought of how to do to it, but it isn't working IF(ISPICKVAL(Override__c, ...
1
vote
1answer
338 views

Apex Test not updating parent object field based on child object formula fields

I have a before insert, before update trigger that updates a value in a parent object when a new child object is inserted or updated. The child object contains loads of checkboxes which are used by ...
0
votes
1answer
57 views

bucket a multi select picklist within a report?

Quick question Can you bucket a multi select picklist within a report ? If so how can you do it ?
1
vote
1answer
41 views

Date Stamp on one criteria within Picklist

I need some help Aim – When stage = ’Declined’ populate a field called “Declined date” with the date that declined was selected Field: Stage Data type : Picklist I know how to create a workflow on ...
2
votes
3answers
107 views

Validation rule for data dependency

I'm new to coding in Salesforce and I'm trying to code the following logic: If a certain picklist value is chosen, another certain field cannot be left blank. I wrote the following but I'm not sure ...
1
vote
2answers
38 views

Simple formula help

Hi guys, for some reason I cannot wrap my head around the formula syntax, and I could use some help. I understand this is a very easy and should be trivial. My requirement is that IF SAP Ship-to ...
1
vote
4answers
323 views

Validation rule on 2 picklist fields

I'm trying to create a validation rule formula in Salesforce, that uses two picklist fields. If the first has any value selected, the Second picklist can NOT have any value selected. So basically if ...
0
votes
2answers
40 views

Picklist formula help

I'm trying to do validation for a values on a pick-list and a text field. I was thinking something like this. IF(ISPICKVAL( SAP_Transportation_Zone__c , "USA") && (Country__c != ...
0
votes
0answers
18 views

Need help with Multi Picklist Validation Rule [duplicate]

I have a question for you IO have posted this here as a user and not under my name Multi Picklist Validation via Apex? Aim – Create a validation rule, where only 5 picklist values can be choosen ...
0
votes
0answers
132 views

Using the date/time Opened + Closed fields in cases, can I create a report or formula to show the 'time open?'

Morning all, I am having a few issues trying to create a report/formula field using the 'Open date' of a case and the 'Close date' of a case. These are both Date fields. I simply want to show how ...
3
votes
1answer
304 views

Do cross object formulas only work if the lookup field is on the same object as the formula field?

I have recently been using cross object formulas (I'll use COF for notation) for the first time, and as far as I can tell the only way to use fields from another object is if the lookup is from the ...