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
0
votes
2answers
841 views

Sum Two Customer Formula Fields

Is there a way to sum the value from two custom formula fields into a separate formula field? I am trying to set up a prospect score in Salesforce based on the customer's lead source. Due to the ...
0
votes
2answers
1k views

Date/time field cant be selected in scheduled action in Process Builder

I have a custom object with a custom date/time formula field. When I try to select this field in the processbuilder the field does not show up. Am I missing something? See image
0
votes
1answer
46 views

formula field to retun a specific value

I have below formula field now I need to update this formula as if one of the fields is blank then it should return 1 and if 2 fields are blank then it should return 2 and so on for 3, 4 and 5. IF( ...
2
votes
2answers
482 views

Restrict Auto case-number field to specific record type

I've a custom auto case-number field for one of my case record type (Quality Report). Every time a new case is created, the auto case number is generated (ex: QR-1287). However, the auto number field ...
0
votes
1answer
2k views

HYPERLINK function in a formula field returns different results

Background I have a custom object Recipient__c with a Lookup relationship to Contact. Also it have another Master-Detail relation to another custom object SomeObject__c. The Name field for this ...
0
votes
1answer
34 views

Someone please help me compress this formula - Compiled formula exceeds 5000

Someone please help me compress this formula - Compiled formula exceeds 5000 IF(Today()<Date(Year(Today()),7,1), Case((Year(Pledge_Submitted_Date__c)+YearsToGo__c) -Year(Today()), 4, ...
0
votes
1answer
745 views

How Can I Get A Substring From A Long Text Area Field?

I have a Description field of type Long Text Area. I'm trying to get the first few lines to display. 1. I tried creating a formula field LEFT(Description, 500) I get Error: You referenced an ...
1
vote
1answer
5k views

Formula Field - Case Function

Am trying to build a formula field with multiple IF conditions, so decided to go with Case function, below is the return statement based on the picklist value 0 Member 2 Member 3 Member 22 Only a ...
0
votes
1answer
78 views

We have to update a field value from other object field value based on a certain condition via formula field or not

We have 2-objects called A,B and A is the parent and B is child. We need to update X-field value(Date data type) on B object with A object's Y-field value(Date) whenever A-object's STATUS changes to ...
3
votes
1answer
409 views

Process Builder can't access Platform Event parameters in formula?

I created a Platform Event, and now I'm building a process that is triggered by the Platform Event. The Platform Event parameters either contain a ContactId or a LeadId, but not both. The process I'm ...
4
votes
0answers
2k views

Can Lightning SLDS icons be displayed in formula field without using static resources?

I want to display an icon in a formula field based on the value in another checkbox field on my object. I would like to use the standard Lightning SLDS icons here. I've found a way to achieve this ...
5
votes
1answer
192 views

SOQL returning incorrect value

This is throwing me for a loop. I have a custom field on user, Backend_User__c. The formula is pretty simple: IF( OR( Profile.Name = "API Only", Profile.Name = "Boldchat API Only", Profile....
0
votes
1answer
66 views

Reducing Size of Case Statement

CASE( RegisteringCountry ,"Argentina", "India", "Australia", "India", "Bangladesh", "Singapore", "Belgium", "India", "Bhutan", "Singapore", "Brunei Darussalam","Singapore", "Brazil", "India", "...
0
votes
1answer
371 views

How to create logic to lookup for custom case number on case object? [closed]

I have a Visualforce page which is used to create customer service related cases on the case object. We have a custom case number value for each case created (QR-1001, QR-1002 .....). For certain ...
2
votes
2answers
826 views

Formula field to get records created this week on activities

I have a requirement where a checkbox is to be checked if a record is created by a specific profile this week on activity. So, I got the following formula: IF(CreatedBy.Profile.Name = "Territory ...
0
votes
1answer
337 views

First error: common.exception.SfdcSqlException: ORA-00920: invalid relational operator

I have created formula field named "Second Audit Required" as shown below : IF(And(AND(Text(Status__c)='Closed',TEXT(ServiceStep__c)='Treatment',Order__r.Account_Name__r.Account_Types__r.Name='...
1
vote
3answers
1k views

Merge Date & Time field in to datetime field using formula field

We have to separate fields to pick appointment date & appointment time in Custom object. Now we have to filter out appointments between two dates (w/ time), so I need to compare appointment date &...
3
votes
1answer
1k views

recalculateFormulas() throws an unexpectedException. Unable to create/update fields

I have a function in Apex that sets a few fields on my custom object and that also calls the recalculateFormulas() function on the object. I call my function from Salesforce through a custom button. ...
1
vote
1answer
444 views

Picklist values in a formula on a validation rule (along with text fields)

I have a validation rule on the contract object which doesn't allow a checkbox to be checked by users until they have completed the required fields. The issue is that some of these fields are picklist ...
0
votes
1answer
35 views

How do I access the Phone field (Event standard field) on a formula on Activity?

I'm trying to create a custom formula field on Activity that looks something like this: SUBSTITUTE(Phone, '-', '') However, the syntax checker says the Phone field simply doesn't exist, even though ...
0
votes
1answer
48 views

Calculate hours from two text fields

I have a custom object called Log. It has two fields : StartTime__c and Endtime__c. R1.StartTime__c = '05:58 am'; R1.EndTime__c = '11:54 pm'; The number of hours between StartTime__c and ...
4
votes
2answers
604 views

Why formula field can not tackle the following issue?

While preparing myself to the Developer 1 certification I met the following question: Universal Containers requires a Service Representatives to update all Cases at least once every three days. To ...
0
votes
0answers
160 views

Difference between two datetime fields giving negative values

I am using the below formula to calculate hours between two datetime fields.But total is coming as -16. What is the problem happening. Start_Date__c = 30/07/2018 06:59 End_Date__c = 30/07/2018 14:29 ...
0
votes
2answers
28 views

Can I stop a process if the field update values are the same or similar?

I have a process builder that creates a case when an Account name has been changed. My company builds software for hospitals, which fairly frequently change ownership and names. The case is to alert ...
0
votes
2answers
56 views

How to get formula field from invoice without update

I have made a counter for invoices for several offices. The current office to create an invoice is determined by a formulafield. How do I get this in my testclass I tried to query the invoice but it ...
0
votes
1answer
531 views

List View - display names as Last Name, First Name in Lightning

In classic, the Name field for Contacts in List View always displayed Last Name, First Name. In lightning, they seem to have switched this to first name last name. I would like to unswitch this. I ...
0
votes
1answer
52 views

Text formula field does not shows the full id of an custom object

I have a formula field called CandidateKey__c which can hold either an opportunity or account id. I have noticed that the CandidateKey__c is not showing the full Id of opportunity or Account objects. ...
0
votes
1answer
192 views

If statement based on created by profile name to show value is custom formula field

This new field will be called "Line item Total Test" on Opportunity Product. This Formula is not working- IF(CreatedBy.Profile.Name = "Standard User", TotalPrice), IF(CreatedBy.Profile.Name = "...
0
votes
0answers
39 views

Formula logical operators currency madness

Either there is something really wrong going on with SF or I'm going crazy. I have some fields: Total__c, Amount_Received__c, Amount_Refunded__c (Currency) Amount_Paid__c (Formula Currency) ...
0
votes
1answer
31 views

formula values are not getting in URL in Production

I created a custom button on custom object. Behavior= "Execute Javascript" Content Source="Onclick Javascript" I have written the following code in sandbox. It is working in Sandbox. But, In ...
0
votes
1answer
2k views

Error: Field CompanySetting__c does not exist. Check spelling [duplicate]

I can't figure out what's wrong with this field formula. Everything below in quotes has been copy/pasted directly so there are no typos AFAIK. Custom object API name = CompanySetting__c Custom ...
1
vote
1answer
2k views

check if a particular date falls in the current quarter

I have a requirement to check if a particular date field falls in the current Quarter. Hence for this I had used a Boolean formula Field which returns true if it falls in current quarter and false if ...
0
votes
1answer
73 views

Is Salesforce adding decimals wrongly?

Problem Description: Having weird decimals calculation Field 1(formula(Currency)): 0.53 Field 2(formula(Currency)): 5.27 Formula field Total = field 1 + field 2 Total = 0.53 + 5.27 Expected: ...
0
votes
1answer
993 views

Get picklist value LABEL in formula field

My question can sound trivial, but the issue below seems to be serious. We can use TEXT(field) to get picklist value in formula field. The issue is that this method returns API name of particular ...
0
votes
1answer
200 views

Can I store my block of apex code as formula field and execute in apex

I am trying to achieve like an Apex invoke-able method that takes input Object Name, field(s) to update, values for the corresponding field, Ids to use in query, the Apex method will query based on ...
0
votes
1answer
144 views

Formula field on opp using created date, record types, profiles, and multiple stage names

This formula works for all my requirement except the underlined part: IF( AND(RecordType.Name = 'Solutions', DATEVALUE(Account.CreatedDate) <= TODAY() - 10, CreatedBy.Profile....
-1
votes
1answer
29 views

Create formula checkbox field [closed]

I am trying to create a formula checkbox type field on custom object, which gets checked if related list "Notes & Attachment" has any files uploaded to it.
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
1answer
76 views

Why time difference formula field showing 1 minute less or more in time difference?

I am calculating formula to get difference between to date/time fields. But in minutes section it always shows 1 minute less or sometimes 1 min extra. Example if Start Time- 08.06.2018 09:28 End Time-...
-1
votes
1answer
319 views

Formula field with Hyperlink

I am running into this issue ever since i started working on the formula field with hyperlink function: My formula is : HYPERLINK("https://mycompany.getfeedback.com/r/" & Token_ID__c & "?...
0
votes
2answers
81 views

Experiment : Formula field is not working using <> or !=

I am thinking maybe it something I should raise ticket to Salesforce but JIC I wrongly write the formula. I am doing validation rule at Opportunity side comparing two picklist value, one is from ...
0
votes
2answers
843 views

Account Name in Opportunity custom object

I'm trying to create a custom field on Opportunity object with account name. Can I use a formula to populate it automatically? I tried creating the custom field of type Text and adding Account.Name ...
0
votes
1answer
25 views

Formulas limits

I'm trying to write a formula in the custom field Aging__c, in the standard WorkOrder object as follows: IF(NOT(ISBLANK(DATEVALUE(EndDate))), Today - DATEVALUE(StartDate), DATEVALUE(EndDate) - ...
1
vote
2answers
3k views

Formula field cannot be grouped in SOQL GROUP BY query call

I have a Pipeline__c object with fields Segment__c, Status__c, and Sales_Date__c (among many other fields). I also have a Sub_Pipeline__c object which is related to Pipeline__c. Inside I have the ...
0
votes
2answers
198 views

Formula involving Picklist Value, Number and output Image

I have a requirement to produce an image field (i.e one star out of three) based on whether a picklist value is "Supply" or "Supply and install" and determined by the Square meterage number field is &...
-1
votes
1answer
161 views

Set flags using formula field based on Lead records created date

I need to create formula field Before 5 years(2013) lead records are created for that i want to set yellow color flag, & In between 2 years(2013-2016) to 5 years lead records are created for that ...
4
votes
1answer
7k views

How to display Picklist Label, instead of Picklist API in a Formula Field

I think the title says it all, we are using picklist values having different Label and API Name. How can I display the Picklist label instead of API in when using a formula field. I know I can use IF ...
0
votes
1answer
59 views

How to display grouped picklist values as one in dashboards

I am facing difficulty calculating two different picklists seperately for an object. For example, if an organisation object identifies both civil society and education as thematic area picklist, it is ...
1
vote
1answer
799 views

Image Formula and If Statements

I had an image formula field running off a picklist that had fixed values 1,2,3,4,5. The formula worked and showed a red, amber, green, light blue, or dark blue image respectively. To make the ...
4
votes
2answers
890 views

Formula field in SOQL - Performance Impact

Scenario Let's say I have two custom obejcts - Student and Class. The Class object is connected with object Student through lookup relationship. The Class object also has a formula field (...

1
3 4
5
6 7
19