Questions tagged [formula-field]

A formula field is a field that automatically calculates its value from other fields, expressions, or values.

Filter by
Sorted by
Tagged with
32
votes
1answer
695 views

What are the compiled costs of each Formula function

Each formula function has a compiled cost that contributes towards the hard 5000 compiled character formula limit. What are the current compiled costs associated with each formula function?
4
votes
3answers
9k views

Date Formula to Calculate date excluding weekends

I have a formula that is calculating the date from another date field + number of days and returning a date. test census dates field = Confirmed_Enrolled_Date__c + 16 I want to exclude weekends ...
3
votes
2answers
7k views

Formula field change doesn't cause trigger fire

Assume we have ObjectA__c with Field1__c and ObjectB__c with formula field Field2__c which is formula to ObjectA__r.Field1__c. I expected change of record field Field1__c of ObjectA__c would cause ...
3
votes
4answers
13k 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, ...
7
votes
4answers
3k views

Why isn't OrderProduct TotalPrice standard field available in formula merge field list

I am trying to create a custom Formula field on the OrderProduct standard object that is new with the Spring 14 release. However, while the standard fields ListPrice & UnitPrice are available in ...
2
votes
1answer
2k views

Convert a number to its expression in words (e.g. 55 -> fifty-five)

Is there a way to convert a number to a string (Apex code, formula field ..) For example: 5200 > cinq milles deux cents
2
votes
4answers
3k 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 (ED__c+...
1
vote
2answers
2k views

Formula Error: Syntax error. Extra ','

I am trying to write a formula for opportunities but I keep getting the following error Error: Syntax error. Extra ',' Here is my formula IF (TODAY() > CloseDate && TEXT(...
1
vote
1answer
223 views

I have a formula field. I need to display a certain value depending on the local time of the day [duplicate]

I have a formula field. The field should display a certain value depending on the local time of the day. For example, if it is between 9:00 and 12:00 - morning, 12:00 and 3:00 - afternoon, and so on. ...
1
vote
2answers
1k views

how to calculate earliest leap year in formula field salesforce

I am writing a formula where I need a logic for calculating the earliest leap year. Formula (Sum(Mort1, Mort2, Mort3)*1.08^(current year-earliest LP year))+water+ECB+Taxes What logic we can apply ...
0
votes
2answers
106 views

Formulae in workflows

I am trying to add the formulae in the workflow mentioned below: AND( ISCHANGED (Account.Name),OR( ( Account.Type = 'Client'))) but it shows the error as Error: The ISCHANGED function cannot ...
0
votes
1answer
860 views

Field is not writeable: CAM_Members__c.Affiliate_State__c

My compiler says that this field is not writeable: Field is not writeable: CAM_Members__c.Affiliate_State__c I have this class static testMethod void AffliateTest(){ SS_Data__c ns = new ...
-1
votes
1answer
77 views

DATE formula issue

The below is a part of a formula that i wrote, everything is working fine, except for the below. My need is, if the " Renewal Month" field ( which is a month picklist field with values as January, ...
2
votes
3answers
4k views

Excluding weekend and holidays from my days number

I want to retreive the weekend and holidays from my days number! I've created a formula field named weekend where I put : CASE(MOD( Start_date__c - DATE(1985,6,24),7), 0 , CASE( MOD( End_date__c - ...
13
votes
2answers
7k views

Find line break in formula field

I noticed that the Contact.MailingStreet field can be accessed line-by-line in reports with the Mailing Address Line 1, Mailing Address Line 2, and Mailing Address Line 3 fields. I want to create ...
5
votes
2answers
5k views

Counting multi-select picklist selections in a formula

I would like to ask something about FORMULAS. I have a multipick list field where the user select one or more options(text), i would like to count how many options he select and multiple that for one ...
4
votes
1answer
1k views

recalculateFormulas() causing UnexpectedException: Unable to create/update fields: IsDeleted

When I update my custom Record__c a trigger runs, and it calls recalculateFormulas() on the record. This results in the following error: System.UnexpectedException: Unable to create/update fields: ...
3
votes
1answer
3k views

Formula filed to display image, works in classic not in lightning

The below formula displays green red or yellow in the field based on the calculation. It works fine in classic view but not in Lightning. I read that as of Winter 15 images were not supported in ...
2
votes
2answers
838 views

Buttons with dynamic titles in formula Field Buttons?

Question Is there anyway to create an image for a button with a variable title for use in a formula field? Background A common request I get is to put buttons in the page layout itself as the ...
1
vote
2answers
6k views

Difference between 2 DateTime fields in Hours and Minutes with timezones

I am having trouble in finding the difference between 2 datetime variables and reducing the offset timezone difference in order to get the local time from the salesforce generated GMT time. I have a ...
14
votes
1answer
1k views

Salesforce1 and HYPERLINK() showing raw html

Has anyone found a way to have a field, which is a formula field that uses HYPERLINK(), to display correctly in the Salesforce1 APP? Currently in the browser based Salesforce1 it functions correctly, ...
4
votes
2answers
8k views

How can I use a formula field to retrieve a record in a lookup

I have created a lookup field between the Quote Line Items object and a custom Discounts object. I want to retrieve a certain discount dependent on discount code and product category. My Discounts ...
4
votes
2answers
1k views

Can anyone help with a formula to pull an email address from a text string in a standard field?

I am trying to pull an email address from a text string in the standard "Description" field on Case object. The below formula is correctly pulling everything AFTER the "@" symbol in the email ...
3
votes
4answers
9k views

Formula field on parent object to get last related list record field

I'm trying to create a formula field on a parent object that will retrieve a field from the latest record in a child related list (without apex if possible). The related list is from a lookup field ...
3
votes
2answers
9k views

How do we get user's time zone offset integer in Apex or Formula Field?

How do we get user's time zone offset integer in Apex or Formula Field? For example, a user's personal information time zone (GMT-04:00) Eastern Daylight Time (America/New_York) should return -4. ...
3
votes
1answer
3k views

How to query for formula fields in test classes

From what I understand, formula fields are calculated when a record is opened/read. If a record is created by a controller extension and then queried then it's never really opened or read, so ...
3
votes
1answer
601 views

How to implement Formula field for FullPhotoUrl in User object?

I need to create formula field that populate full URL of FullPhotoUrl in User object.Currently the value of FullPhotoURL is'/profilephoto/729n00000004DSL/F' where I cannot use for my third party ...
2
votes
1answer
2k views

Giving formula values with multi-select picklist

I am trying to make a formula that will give values from a multi-select picklist and i want to know what is the fastest and cleanest way to do this? Video_Monetizing_tool__c != "No" to give a value ...
2
votes
1answer
177 views

Critical Update: Trust Percent Values in Flow sObject Variables Again

When I go thorough this critical update's description it says, Previously, our calculations on percent values weren’t always working as expected. We rolled out a partial fix earlier, and this ...
2
votes
2answers
53 views

Help with Formula field IF

I am creating a Formula field that returns texts when: Picklist_Status = Activated, the return text should be A else null Picklist_Status = Sold, the return should be B else null Picklist_Status = ...
2
votes
2answers
910 views

Formula for finding business days since last interaction

Trying to figure out why this formula is only returning a 1 or a 6. I am trying to figure out how many business days from when a case was created or from the last update. IF( ISBLANK(...
2
votes
2answers
2k views

Can a formula field be indexed?

I have a formula field called ContactID18__c on the Account object. The formula is CASESAFEID(PersonContact.Id). Can this field be indexed or no because it is a custom field and a formula? Or is ...
1
vote
2answers
2k views

How to pull SAML Federation ID into a Formula Field?

One of my custom objects have a relationship with User object. I need to pull SAML Federation ID (Field Name: FederationIdentifier) of User object into a formula field in the custom object through ...
1
vote
2answers
4k views

How to get the all prior field value in textearea field or formula field

I have one text field like priority and I will change every day the priority. now I would like to store the prior values in the text area field or formula field. how to do? Temporary i am viewing the ...
1
vote
1answer
3k views

Image formula field in lightning do not display images,

I have a lightning component to display a image formula field in the lightning app and Community. when added this field to the lightning app image is not rendering instead it just displaying the html ...
1
vote
1answer
2k views

How to convert text field number value to text in formula field?

I created input text field (money__c)value is 55995999. Where in this value, how to add commas using text formula field value like 5,59,95,999 Can anyone please guide?
1
vote
4answers
418 views

Formula Field creation

I have created the Custom Field Field called DateTime1__c with type as (Date and Time) in order object. When creating record in object, if i give value for DateTime1__c field, then another custom ...
1
vote
1answer
488 views

Javascript Hyperlink formula field

Is it possible to embed javascript in Hyperlink formula field to open a vf page in a pop up?Can you share the formula,if possible?
0
votes
1answer
376 views

How to make a date formula which calculates current month + 3 Full months in Salesforce

I am using a Process builder to set value to the field expiry_date__c based on booking_date__c Example 1: If booking_date__c is 12th June 2017, the expiry_date__c must be calculated as current ...
0
votes
1answer
1k views

Creation a Formula field with boolean

Here is the story I have bunch of products that they can be added to "Add Quote Item" I want to be able to get all the products that are taxable first (Use a boolean and then the agent will check mark ...
0
votes
1answer
118 views

Report Filter - Cannot Use Formula?

I am trying to customize an existing Report to filter based on a formula field. It was created with a Custom Report Type of My Object with Child with Grand-Child. Now we want to filter it based on a ...
0
votes
2answers
583 views

Adding Text before Formula that returns a number

I've developed a formula that will convert a date field into the week number.See code below. CEILING((( Trial_Account_Date_Created__c - DATE(YEAR(Trial_Account_Date_Created__c ), 1, 1) + 1) + MOD(...
0
votes
0answers
37 views

Formula to get lessor of two date fields before comparing to another third date field?

I am trying to find the lessor of two date fields, then comparing that "lessor" date field to another date field to trigger a checkbox on/off. Here is the current formula, however, im trying to ...
0
votes
2answers
216 views

Multiple IF Statements for Formula Checkbox

I am new to Salesforce, and am still learning about the formula fields...so please bare with me. I am looking to create a formula for a new checkbox called Past Due to perform the following functions:...
0
votes
1answer
935 views

Changing Semicolon from Multi-Select Picklist values to a Comma

I am having difficulty creating a formula that would remove the semicolon from Salesforce Multi-Select picklist values to a comma. Basically I want "A;B;C" to appear as "A,B,C" I tried using a ...
0
votes
1answer
127 views

How to track previous Dates using formula field

Ticket_tracking__c is a date type field and Old_register_tracking__c is a formula field. I need the formula field like, while i am trying to change the Ticket_tracking__c field, then the prior values ...
0
votes
2answers
51 views

Formula is to big to execute…What else can I use to write a formula for a field

Hi I am just wondering if I wanted to write a formula that computes a number for specific field, how else can I go about doing this? I am currently using the advanced formula section for the field and ...
0
votes
2answers
3k views

Using formula to exclude weekend and holidays in salesforce

I have a requirement where in, i have to exclude public holidays listed below: (14-Jan-2015, 26-Jan-2015, 06-Mar-2015, 17-Sep-2015, 02-Oct-2015, 22-Oct-2015, 11-Nov-2015, 12-Nov-2015, 13-Nov-2015, 25-...
0
votes
1answer
148 views

Create a report that will display all contracts with six months remaining before their expiration dates

This seems like a very simple question, but I am quite confused. I am using standard Contract object, and I created a formula field Half Year Expiration Date which has a formula of EndDate - 182.5. ...
-3
votes
1answer
251 views

Syntax error in Creating a formula [duplicate]

My below formula is showing a syntax error, Can anyone plz suggest where its gone wrong in syntax. I am using it in process builder. I have a month picklist field in lead " renewal month", if the ...