New answers tagged formula
0
votes
Accepted
Update a Date field on the record in Flow Builder from the output of a formula date field
Let's assume you have these fields set up in your object:
StartDate__c: as Date field
RequestedMonths__c: as Number field
ReturnEndDate__c: as Formula field (of type Date)
To reach your ...
0
votes
decimal places and text() formula
Maybe not an answer for the question but my solution for similar issue when it was needed to have always two decimals:
IF(
NOT(CONTAINS(TEXT(ROUND((Field__c * 100), 2)), '.')),
TEXT(ROUND((...
1
vote
Help creating a filter
Try creating a formula field of type number and decimal place zero.
Use below formula
IF (IsClosed, Round(ClosedDate - CreatedDate, 0), Round(NOW() - CreatedDate, 0))
Use this formula field as a ...
0
votes
The formula expression is invalid: Syntax error. Found ')'
I am also running into the same error The formula expression is invalid: Syntax error. Found ')'
I am trying to create a formula in a flow.
IF (
{!radio_Please_select_a_product} == {!...
1
vote
Accepted
Summary Level Formula - Sum Closed/Won Opportunities
You have to do this in two steps
Step 1 - Create a Row Level Formula called Amount Won
IF (ISPICKVAL(StageName,'Closed/Won',Amount,0)
Step 2 - Create a Summary Level Formula that sums the row level ...
0
votes
Accepted
How to convert date/time field to a text field using formula
Use below logic for the Date time field.
LEFT(TEXT( field2 ), 10) + ' ' +
TEXT(IF(
OR(
VALUE( MID( TEXT( field2 ), 12, 2 ) ) = 0,
VALUE( MID( TEXT( field2 ), 12, 2 ) ) = 12
),
12,
...
2
votes
When I would change a formula, then when the value from that formula will change?
Formula fields do not have their values stored, they are calculated on-demand.
Every time you query a record in Apex or view a record in a web browser, the formula fields are re-calculated. So there ...
0
votes
make text highlighted red & bold if criteria is met?
Not Exactly the answer but very useful and can be adapted
Here is a Formula Text Field with an Image:
CASE( TEXT(Rating__c),
"1", IMAGE("/img/samples/color_red.gif", "RED&...
0
votes
Calculating the start of a new month in SF
An easy way to do this would be with scheduled flows.
You can set the flow schedule to run daily and then use a decision element to check if it's the first of the month. You can do this by creating a ...
0
votes
Calculating the start of a new month in SF
So you have many options to do so but I suggest the below -
Write a batch class to do this operation and schedule it on the 1st of every month using corn expression.
So your job runs on the 1st of ...
0
votes
Accepted
Tracking number of contact attempts based on Tasks under Contact
No, it is not possible to have a formula field execute a query.
Further, what you're trying to do (count the number of records related to a parent) is also not possible with a formula field alone.
The ...
2
votes
Accepted
Formula field date subtraction
Simple date subtraction, as Amit suggests in the comments, would be a decent approximation. Datetimes (and their closely related cousin, Dates) can be subtracted to give you a decimal (in the case of ...
0
votes
Formula field date subtraction
I found that I messed up the order of substraction. Below the correct way which is working:
IF( AND(((YEAR(End_Date__c) - YEAR(TODAY()))*12) + (MONTH(End_Date__c) - MONTH(TODAY())) < 3,NOT(ISBLANK(...
0
votes
Formula Help - alternative of using nested if in formula due to size limitation
There is dirty approach; Introduce dummy fields and create formula around the same. For example,
Project_Schedule_Override__c --> Prj_Sch_Ov__c; the field is simple formula field like TEXT(...
1
vote
Formula Help - alternative of using nested if in formula due to size limitation
Often with this sort of situation, the proper course of action is more of a paradigm shift; rather than fixing or improving this formula, it might be more prudent to ask if a Formula Field is the ...
1
vote
Accepted
How to change boolean result to a compatible currency value in a formula field
A few things to note here:
When you are making multiple comparisons against a single field, you should consider using CASE() to save yourself a potentially significant amount of typing
A formula ...
1
vote
How to change boolean result to a compatible currency value in a formula field
Remove the last IsBlank(null) instead, just make it null. By saying IsBlank, you are returning true (as null is always blank) and hence the complain from the compiler.
0
votes
Accepted
Format a date in a Flow?
Try taking a date variable in the flow.
Now Suppose your variable is originalDate.
Your formula will be for storing date as MM-DD-YYYY will be -
TEXT(MONTH(originalDate))+ "-" + TEXT(DAY(...
0
votes
How do I remove all text and characters from a Text field except 0 - 9
If you need to use Apex, then I would use String.replaceAll with a regular expression that matches non-digit characters (\D).
String phone = '(555) 867-5309';
final String nonDigits = '\\D'; //any non-...
1
vote
Return the start of a email domain
you can try using this formular:
LEFT(Email_Domain__c, FIND(".", Email_Domain__c) - 1)
it returns everything before the first dot. Hope it helps.
0
votes
How are stored percentage fields ? They don't always return the same value
Please, refer to this article:
https://help.salesforce.com/s/articleView?id=000351429&type=1
Even though it is a bit counterintuitive, it looks understandable.
Top 50 recent answers are included
Related Tags
formula × 1572formula-field × 394
apex × 137
validation-rule × 121
workflow × 120
process-builder × 99
validation × 98
date × 90
picklist × 77
custom-field × 71
datetime × 66
reporting × 60
visualforce × 57
visual-workflow × 51
trigger × 50
field-update × 36
administration × 30
case × 27
opportunity × 27
roll-up-summary × 26
lookup × 23
custom-object × 22
if × 21
community × 19
email-template × 19