The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [formula]

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 Validation Rules and criteria for Workflow Rules and Approval Processes.

Filter by
Sorted by
Tagged with
0
votes
1answer
9 views

I need my Process entry criteria to look at the value of a currency formula field

This is a bit complex-but I'll try to simplify. STATEMENT "Transaction" object has a Custom Currency Formula Field "Amount Outstanding" Child object "Payment" has a Status pick list field. I want ...
0
votes
0answers
19 views

How to fetch whatId label in salesforce formula field

I have requirement where in WhatId should be able to display parent name(label) in formula field, i have tried using what.Name in formula field but it displays an error. The below code fetches the 15 ...
0
votes
1answer
32 views

Formula Expression Error

Receiving the following error if anyone can see where the error is? Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2 IF( (NOT(ISBLANK(Population__c)) &&...
-3
votes
0answers
28 views

Formula Multiple If statements [on hold]

Formula: The first part works fine by itself but the user has now changed their mind and I can't figure out a way to combine all three in one formula field. Any advice? ( no these are not separate ...
0
votes
1answer
15 views

Image formula field render issue

I have a formula that is rendering a static resource based on checkboxes on my Contact record. The issue I am seeing is that when the image loads, it appears super tiny - the static resource is not ...
1
vote
0answers
19 views

Unable to Validate flow input using formula

I'm trying to validate a flow text element called subject. I created a formula called validateSubject with the following logic: If(LEN({!Subject})<255,true,false) I added this formula to the ...
0
votes
1answer
28 views

Error: Syntax error. Missing ')' in Formula field

IF(TIMEVALUE(CreatedDate) <= 19:00:00.000, 'TODAY', 'TOMORROW') I am getting following error for the above formula. What could be possible cause? Error: Syntax error. Missing ')'
1
vote
1answer
28 views

Formula field for duration as time

I have an object that has two Time fields: Start and End. I want to add another, Formula field that would show me the duration also as Time. Unfortunately, when i do simple things like Duration=End-...
1
vote
0answers
24 views

Flow failing in Field Service Lightning Mobile App but not when run in Browser

I have a flow that is setup to be ran through the Field Service Mobile app. Recently I have made some updates to it, specifically having two fields that are set by the flow be set by formulas instead ...
0
votes
1answer
56 views

Calculate Months between two dates? [duplicate]

On quote whenever user specifies Start Date and End Date we need to calculate Subscription Term which should be exact months, here it should say 12 months but its showing 11.96. Can anyone please ...
-3
votes
1answer
26 views

How to apply 3 conditions in formula field?

I am trying apply 3 conditions in formula field. but I'm to complete the requirement. My formula will be like this IF( AND( CreatedById = 'xxxxxx', ISPICKVAL(Scenario__c ,'Budget'...
2
votes
1answer
31 views

Working round the lack of formula fields of type “Lookup Relationship”

When you have a master-detail chain of objects several levels deep, sometimes a lookup field to the root object on each child object is helpful for easy navigation or to show deeper records than the ...
0
votes
1answer
35 views

Is it possible to create a process builder to set multiple field values?

Is it possible to create 1 formula string to include multiple field values as shown in the screenshot? This would save a lot of time by not having to enter each value one by one. I have several more ...
0
votes
0answers
7 views

How to create conditional statements with textual groupings in report summary formulas?

I have a matrix report that has several level of groupings: Rows: Sales Stage (Picklist: "Won YTD", "Pipeline") Brand (Picklist, e.g. BMW, Ford, Mercedes) Column: Close Date (Date, grouped by ...
0
votes
0answers
16 views

error with validation rule when making list of past roles

i'm working on making a list of past roles which include a start and end date from when the role was held. however i'm having trouble making it so before adding a new role, the previous role must be ...
0
votes
1answer
54 views

How to calculate Current quarter and last month of previous quarter in List View?

I need a list view to display List of records of current quarter and last month of previous quarter. I think I need to write a formula field to calculate current quarter and last month of previous ...
0
votes
1answer
39 views

How can i get Account id in Lead object for Formula

Firstly i need the write query in mailchimp entegration for salesforce contacts and leads, in this case i will get 1 checkbox situation. with formula but in leads i dont have lookup for account rather ...
0
votes
1answer
47 views

Conditional custom button on page direct to URL if condition = true, display message if false

I have a custom button on a custom object page from which I generate a VisualForce PDF document (Content Source = URL). There are conditions, however, where the PDF should not be generated based on ...
0
votes
1answer
19 views

bold/change text color in a workflow rule?

i'm using a workflow rule to update a rich text field to be highlighted red (or just text red) and bold. and i'm struggling with how to get the html into the formula? IF(STATUS == 'New', <html>&...
-3
votes
1answer
42 views

make text highlighted red & bold if criteria is met?

i have a requirement that if my text field has a certain value it should be displayed highlighted red and bold. at first thought i'm thinking i have to change the field type to a formula field that ...
0
votes
0answers
23 views

How can I get an Average of a Summary Formula Field?

I feel like this might be a really simple solution but I can't seem to figure it out.  I'm trying to calculate the Total and Average Number of Days between two dates. From the other posts online I've ...
0
votes
1answer
29 views

Validation Rule - Picklist being ignored

I am trying to create a validation rule that has multiple sets of criteria, one of them being preventing the LeadSource picklist field from being blank. Below is my formula which for some reason ...
0
votes
0answers
8 views

Double Grouping using PREVGROUPVAL

Using PREVGROUPVAL() to calculate TR 3 Month MA Amount for each sales rep. I cannot seem to get this formula to work. Was wondering if its even possible to use PREVGROUPVAL when its nested in the ...
0
votes
1answer
18 views

How to Access field from Detail object in Master object?

I have a customer object as master and Document object as Detail which has a Status__c field. Since its a Master-Detail there can be multiple Documents to the custom object. I want to maintain a ...
0
votes
1answer
16 views

How to write formula field to replace multiple values in the field?

I have a field with the value 1;2;3;4;5;6;7;8 I would like to replace with one;two;three;four;five;six;seven;eight through formula field. Workaround: Used Substitute function: SUBSTITUTE(Name, "1", "...
0
votes
1answer
28 views

formula criteria is not working for updated record, it's working for New record

Here is my formal for PB, it's firing when record is created but not when record is updates with released__c/status__c changes, am i missing some thing? OR( AND( ISNEW(), NOT(ISBLANK([ticket__c]....
2
votes
1answer
39 views

Only the first IF condition works, and the rest doesn't when nested in Process Builder formula

GOAL: I'm trying to create this criteria in Process Builder where I can detect phone number like (000) 000-0000, 000-000-0000 and 000.000.0000 and turn them into +1 0000000000 format. I tried to ...
0
votes
1answer
30 views

Help with Formula

I am getting a 'syntax error' error message when attempting to use this formula as part of a workflow rule criteria. I have double-checked the field names are all correct. Can you tell me where I ...
0
votes
0answers
49 views

How to Use Formula Field to Log Out and then Open a URL?

Background I'm trying to set up a Formula (Text) field with the HYPERLINK function to log a user out of their session and then open an external URL: HYPERLINK("/secur/logout.jsp?retURL=www.google....
-3
votes
2answers
51 views

How to get the Latest record created date in salesforce?

I have a field called "Date" on custom object "TestData__c". If I create a record today I need to display today date.If I create a record tomorrow I need to display Tomorrow date.How Can I achieve ...
1
vote
1answer
23 views

Process Builder - Formula Execution

I'm attempting to use process builder to execute the following formula to average a set of picklists (ran into limit with formula field). I'm getting an error that Field Mission_Aligned__c does not ...
0
votes
1answer
15 views

Regex for Text Field in Flow screen input validation gives error

REGEX( {!Phone} , "((^[?+\+\s]|^[\d]?)([\s\-\.]?)([\d]{1,3})([\s\-\.\(]*)([\d]{3})([\s\-\.\)]*)([\d]{3})([\s\-\.]*)([\d]{4})$)" ) Phone (Screen Component) - The formula expression is invalid: ...
0
votes
0answers
38 views

Help with formula field:

Below formula count 1 when statement is true and count 0 when statement is false. I am using this formula to calculate bad data populated being populated in lead object. Output of this formula is ...
0
votes
0answers
19 views

Phone (Screen Component) - The formula expression is invalid: Syntax error

I have Text field on Flow Screen component that I use for Phone number. In validate input section i have wrote REGEX({!Phone} , "^(\+(([0-9]){1,2})[-.])?((((([0-9]){2,3})[-.]){1,2}([0-9]{4,10}))|([0-...
1
vote
1answer
20 views

WFR criteria formula And with Nested OR

trying to add and OR syntax into my formula. AND((Name <> Contact__r.LastName + " - " + Term__r.Name), OR(Record_Type_Hidden__c <> "New_Agent",Record_Type_Hidden__c <> "...
0
votes
3answers
52 views

Draft Formula Syntax Error

The purpose of this formula is to assign numeric values to some picklists and average them. This is a second draft which returns syntax error Missing ": ( CASE ( Mission_Aligned__c, "No elements ...
2
votes
2answers
27 views

Formula showing Day Of Week and CreatedDate as a Text String

I am trying to create a formula field that will return the Day of the Week concatenated with the date the record was created. The end result should look like this: Tuesday - 8/13/2019 I have this ...
0
votes
1answer
57 views

How to convert a number field to days hours minutes

I have a number field which is Average Time calculated based on difference between two date fields , i want to convert this number field into Days Hours Minutes , how can we achieve this. I have ...
-2
votes
1answer
26 views

Concatenate Picklists In Formula

I am creating a formula field to concatenate the picklist value with nested if..How can i achieve this as my formula is not working my requirement is IF Pricing Method=[A, B, Firm]…Cost Method='A' ...
0
votes
1answer
36 views

Error: Syntax error. Missing ')' -

I wrote a formula for a field Target per Month per Opportunity owner that should populate with currency when an opportunity has a certain close date month. IF( AND( Owner.Id = 0054J000001U0X4QAK, ...
1
vote
1answer
40 views

Case Formula Syntax Error

Any ideas on why this returns Missing ")"? Thanks! CASE ( Mission_Aligned__c, "No elements aligned",1, "Few elements aligned",2, "Some elements aligned",3, "Most elements aligned",4, "All elements ...
0
votes
0answers
33 views

How can I stop multiple case update notifications being sent?

I've created a PB which notifies the case owner whenever a case they own is updated. The issue is that I have a number of child objects (and processes) which update the case record when an action is ...
0
votes
2answers
40 views

Returning wrong order in SOQL ORDER BY

I'm facing a problem with the SOQL ORDER BY. I'm quering on a custom object with this query SELECT completeTreeSequence__c FROM CPQ_Line__c WHERE CPQ_Header_RU__r.Id = 'a043E000005PfD7QAK' ORDER ...
1
vote
1answer
56 views

formula not calculating correctly

I have a field, Requested Completion Date that needs to be calculated by adding the Length of SOW (Months) to the Requested Start Date and the date that it returns needs to be on a weekday. I have the ...
0
votes
1answer
98 views

Use Picklists in Formulas - Admin Advanced Trailhead Module

Can someone help me with this error? There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on ...
0
votes
1answer
46 views

Formula to Access Network Folder/Files

Im trying to access my local folders using custom Formula'Hyperlink' function This is my formula Test Open = HYPERLINK("file:///" & Path__c ,"Go To"). When I click the link it gives blank ...
1
vote
2answers
51 views

Need help with the Formula Field in Salesforce. I must have not entered the formula properly. Need help

For the purpose of having a prospect list as a report, I would like to show up in the report only leads/contacts in a campaign member list owned by the logged in User AND the leads owned by a queue. ...
0
votes
0answers
20 views

Save previous sibling value in new field

I've got a formula that requires me to use the createddate of the previous entry in a field. I think I've determined in order to do this, I need to create a new field (PriorDate) that records this ...
1
vote
2answers
49 views

Concatenate custom picklist field with number field

'Location' is the field name and is field type = picklist 'Account_ID' is the field name and is field type = number I want to concatenate these two. My formula is TEXT(Location) & "-" & ...
-3
votes
1answer
35 views

Contract End Date Formula

I've been racking my brain for about 8 hours trying to figure out how this formula works, or I guess WHY it works. DATE( Year( Contract_Start_Date__c )+floor((MONTH(Contract_Start_Date__c) + ...