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
14 views

How do I send an email based on a date difference?

For example, I have some DateTimeField__c, and if DateTimeField__c - NOW() = 11 (hours), I should send an email. Trigger is not a variant, because I can't check with it a formula field. A Scheduled ...
0
votes
1answer
16 views

Formula field is updating continious with current date time

I am assigning current date time on formula field once the correction counter value is 0.6 but the date is updating again with latest time . I want that if correction counter value is updated to 0.6 ...
0
votes
0answers
17 views

PRIORVALUE function cannot reference the Account.BillingCountry field with error on ischanged(Account.BillingCountry)

Trying to create formula like : AND( RecordType.DeveloperName = 'recType' , ISCHANGED(AccountId), Product_Cnt__c<>0, OR( AND( ISPICKVAL(PRIORVALUE(Account.BillingCountry),Account....
1
vote
0answers
24 views

Add 30 minutes to a Time field using formula

I'm trying to set a formula time field as the result of adding 30 minutes to a time field that returns TRUE in the following comparison.: Time formula field is: TimeEndWorkingHoursControl__c = ...
0
votes
2answers
14 views

Formula Field in Process Builder for Opportunity Stage [closed]

I am unable to write the formula in process builder for the criteria when Opportunity Stage equals "Approved/Not Shipped" OR "Converted" My formula: ISPICKVAL([Opportunity].StageName , Approved/Not ...
0
votes
0answers
18 views

Refactor formula to avoid exceeding character limit

I have the following formula field: IF(AND(TEXT(Method__c)="FedEx Ground", Residential__c = TRUE),"GROUND_HOME_DELIVERY",IF(AND(TEXT(Method__c)="FedEx Ground", Residential__c = FALSE),"...
0
votes
0answers
29 views

prevent malformed id or invalid Id saved for lookup fields

When creating a new record of custom objectA, there's a lookup field orgAccountId binding to account. Regular way is: enter orgAccountId such as 0000001 in the field, press enter, and it will search ...
0
votes
0answers
10 views

URL in Flow Screen open in same window but new Console Tab

I am creating a Flow that will only be shown to Users within a Lightning Component on a Lightning Page. It cycles through a lot of loops and eventually displays a list of records with some other ...
0
votes
2answers
40 views

Wrong decimal formula: I can't get the right value

I use this formula field in my apex code. But I have big troubles with it, because there should be different logic for values 0 and NULL. If I choose Treat blank fields as blanks, I'll get NULL even ...
0
votes
1answer
27 views

please help with approval process!

Need help! I am trying to do an approval process, that will be triggered automatically from process builder. The problem I have, is picklists. I want the approval to go out automatically on the ...
1
vote
1answer
38 views

Math/Subtraction is different between Formula field and Apex

I have a Formula field which does simple subtraction between two other fields. Field X - Formula (return type Number, 2 decimal places). Field Y - Currency(16, 2) The formula field simply does : X ...
1
vote
1answer
35 views

Change Picklist Value on Opportunity

I have a custom object - Object 1 and the Opportunity object. I've created a lookup field from the Opportunity to Object 1 and I am working on a trigger to populate the id of one related record into ...
0
votes
2answers
31 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:...
1
vote
1answer
30 views

Process Builder throwing an error for null lookup value

I have written the following formula in my process builder [Lead].Source_Opportunity__c != null && (ISBLANK(TEXT([Lead].Source_Opportunity__r.Source_details__c)) && NOT(ISBLANK(TEXT(...
1
vote
0answers
31 views

ISNEW and ISBLANK not working together in Process Builder [duplicate]

I am using PB to check if the Case record is new, and if the Account field is Not blank and a Case.Account.picklist__c has a Certain value then update priority. SO, my evaluation criteria are - AND ...
0
votes
1answer
18 views

Read the first number of the field

I need help please on the formula field i want to have value a VISA or MC. I have to read the first number of specific field. For example, the account is 465xxxx868. The account is starting by 4 then ...
0
votes
0answers
26 views

Blank value returned when referencing a custom field on a related custom object on the Account

I have created a Lookup Relationship on the Account object to a custom object named Installation (API name Most_Recent_Installation__c). I want to be able to show a field from this related object on ...
0
votes
0answers
12 views

REGEX in Process Builder Not Working as Expected

Background I've set up a process (in Process Builder) to update the MobilePhone field on the Contact object to this format: +614xxxxxxxx when it is entered in this format: 04xxxxxxxx. It has been ...
0
votes
0answers
32 views

Formula to add 4 hours within business hours

My business requirement is to show SLA(SLA is a custom formula field under cases) as 4 hours within business hours. Our business hours are 8.30AM to 5.30PM CST. Requirement: If any case opened ...
0
votes
0answers
34 views

How do we know the list of sharing rules in the org. using SOQL or apex? [duplicate]

Using SOQL or apex, I would like to read Sharing rules defined in Sharing Settings like for Contact/Accounts in the Org.?
0
votes
1answer
22 views

Different Formula for Different Record Types

I have a custom object that has all the same fields except the value of one depends on the record type. I would imagine I could define a lengthy formula with IF but is there a cleaner way? Ideally, I ...
0
votes
1answer
17 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
23 views

How to fetch whatId label in salesforce formula field [duplicate]

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
35 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)) &&...
0
votes
1answer
22 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
23 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
32 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
31 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
38 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
78 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
29 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
46 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
59 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
8 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
66 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
43 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
94 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
20 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
53 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
28 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
30 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
20 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
33 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
43 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
50 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
64 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 ...