Skip to main content

#Formulas23 personnes en discutent

The following formula is not enforcing the minimum wage rule - either Jobz__r.State_Minimum_Wage__c or 10 - the greater of the 2 is the minimum... unless CA - then minimum is $25.    Formula:    IF(  OR( ISBLANK( Est_Rev_Value__c ), Hours_for_Formulas__c <= 0 ),  0,  (  Est_Rev_Value__c * (1 - Target_Margin__c)  - VMS_Fee_Wkly_Amt__c  - MIN(  Jobz__r.GSA_Weekly_Housing__c,  MAX(  0,  ( Est_Rev_Value__c * (1 - Target_Margin__c) )  - Total_Fixed_Expenses__c  - (  IF(  Facility_State__c = "CA",  MAX(25.00, BLANKVALUE(Jobz__r.State_Minimum_Wage__c, 25.00)),  BLANKVALUE(Jobz__r.State_Minimum_Wage__c, 10.00)  )  *  ( ( MIN(Hours_for_Formulas__c, 40) + MAX(Hours_for_Formulas__c - 40, 0) * 1.5 ) * 1.08 + ( Unbillable_Hours__c / MAX( Contract_Length__c , 1) ) )  )  )  )  - Total_Fixed_Expenses__c  )  /  ( ( MIN(Hours_for_Formulas__c, 40) + MAX(Hours_for_Formulas__c - 40, 0) * 1.5 ) * 1.08 + ( Unbillable_Hours__c / MAX( Contract_Length__c , 1) ) )  )   

3 réponses
  1. 7 juil., 15:20

    Can you create a List View or Report that displays all of the Fields that are in your Formula AND the  Formula Field side-by-side showing multiple combinations of input values and results and post a screenshot?   

     

    It's a LOT easier to troubleshoot when we can see the Input Values going into the Formula and the Output/Results together.

0/9000

We receive donations of food which are valued by pound. The value per pound changes each year. I'm trying to figure out the easiest way to have a "Donated Food Value" field that calculates this for us so that I'm not trusting people to do math. In 2022 food per pound was $1.74 and in 2023 it is $1.92. I want to be able to enter the number of pounds in the "Pounds of Food Donated" field and have the "Donated Food Value" field automatically calculate the value based on the close date. I also need to be able to add a new value each year. Is this possible?

8 réponses
  1. 28 avr. 2023, 13:28

    Okay, if this is just a "once a year thing" and doing an annual update is not too much of a PITA 

     

    Then using a Formula like this, and then updating it each November should work.  You can even build it out by adding ""placeholders" for future years, and fill in the values later 

    Donation_Weight__c *

    CASE( YEAR ( CloseDate ),

    2020, 1.87,

    2021, 1.70,

    2022, 1.74,

    2023, 1.92,

    2024, 0,

    2025, 0,

    2026, 0,

    2027, 0,

    2028, 0,

    2029, 0,

    NULL )

0/9000

I did some searching before I decided to ask this question, as most of calculating business dates refer to a date/time field, and I only need it for just regular date fields.  The business case is that I track internal SF and general Tech requests and I have a Start Date and an End Date.  I don' go by the created date, as often I have to open up tickets and back date what the start date should have been, or adjust the actual start date from the created date.

 

I have a field called # of Days Open and at this time, this is the formula. 

IF( ISBLANK(  Close_Date__c  ) , TODAY() -   Start_Date__c   ,  Close_Date__c   -  Start_Date__c  )

 

I want to modify it, to account for business days (ie, not counting Sat and Sun, in the calculation).  At this time I don't care about Holidays, as I am not sure how to even do that, as we don't get all of the Standard Holidays off.  

 

I was able to create this formula (based off a blog post) but it doesn't take into account if the request is still open like my IF statement.

 

ABS(

 

CASE(MOD (Start_Date__c- DATE(1985,6,24),7),

0 , CASE( MOD(Close_Date__c  - Start_Date__c

,7),1,2,2,3,3,4,4,5,5,5,6,5,1)

,

1 , CASE( MOD(Close_Date__c - Start_Date__c

,7),1,2,2,3,3,4,4,4,5,4,6,5,1),

2 , CASE( MOD(Close_Date__c  - Start_Date__c

,7),1,2,2,3,3,3,4,3,5,4,6,5,1),

3 , CASE( MOD( Close_Date__c  - Start_Date__c

,7),1,2,2,2,3,2,4,3,5,4,6,5,1),

4 , CASE( MOD( Close_Date__c  - Start_Date__c

,7),1,1,2,1,3,2,4,3,5,4,6,5,1),

5 , CASE( MOD( Close_Date__c  - Start_Date__c

,7),1,0,2,1,3,2,4,3,5,4,6,5,0),

6 , CASE( MOD( Close_Date__c  - Start_Date__c

,7),1,1,2,2,3,3,4,4,5,5,6,5,0),

999)

+

(FLOOR((( Close_Date__c ) - ( Start_Date__c) )/7)*5)-1 +

 

( Close_Date__c - Start_Date__c) -  (Close_Date__c  -

Start_Date__c))

 

I also don't pretend to completely understand how this formula is working (just a plain ole Admin here) but I am thinking there has to be a way to do it without basically repeating this(?)

 

Thoughts?

5 réponses
  1. Forum Ambassador Eric Burté (DEVOTEAM)
    1 juil. 2024, 21:30

    Hello @Heath Parks please have a look at this online help article on the same subject :

    https://help.salesforce.com/s/articleView?id=sf.formula_examples_dates.htm&type=5

     

    Find the Number of Weekdays Between Two Dates

    Calculating how many weekdays passed between two dates is slightly more complex than calculating total elapsed days. In this example, weekdays are Monday through Friday. The basic strategy is to choose a reference Monday from the past and find out how many full weeks and any additional portion of a week have passed between the reference date and your date. These values are multiplied by five for a five-day work week, and then the difference between them is taken to calculate weekdays.

    (5 * ( FLOOR( ( date_1 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_1 - DATE( 1900, 1, 8), 7 ) ) )

    -

    (5 * ( FLOOR( ( date_2 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_2 - DATE( 1900, 1, 8), 7 ) ) )

    PS : it will not handle if the case is in stand by within the overall period. It will just consider the difference between both dates

    PPS : Could you please explain the IF rule you have mentioned on your post. How do you expect the calculation to be impacted ?

    Eric

0/9000

i am fine creating the formula for < today, but not sure how to write <current month.   i found this on another thread, but it did not work for me.   

 

IF(AND(NOT(ISBLANK(CLOSE_DATE)),MONTH(CLOSE_DATE)<Month(TODAY()),Year(CLOSE_DATE)<=Year(TODAY())), "Past","Future") 

 

As today is June 18, 2026, it seems it is not taking the YEAR into consideration, but only the month.  

green is returning correctly.  close date year is at the top. 

 

anything june-Dec will show as future, included past years.   

any help is appreciated. 

 

hi!  i need to create a row level formula saying if the close date is < current month, current year, return past, else future.  So for example, today is 6/18/26.  for close dates <=May 31, 26 return

 

 

 

#Formulas

6 réponses
0/9000

I am looking to use the following query to bulk query all the notes and attachments in an org(or by object) so that I can do the migration of N&A's to Files (pre Spring '16 N&A's). Can someone give me a hand with this?

SELECT ContentDocumentId,Id,LinkedEntityId,ShareType FROM ContentDocumentLink WHERE LinkedEntityId = 'YourRecordId'

 

I am planning to run the code in Anon window and review the results

 

Your time and thoughts on this are much appreciated

9 réponses
  1. 4 juil. 2022, 23:45

    I don't know if there is a limit to the size of the Set variable, but I think there is a way to set all the target linked object Ids.

     

    The resulting List variable has a LinkedEntityId field so you can identify the object that contains the file.

     

    List<Account> accList = [SELECT Id FROM Account];

    SET<Id> IdSet = new SET<Id>();

    for (Account acc : accList) {

    IdSet.add(acc.Id);

    }

    List<ContentDocumentLink> ContentDocumentLinkList = [SELECT ContentDocumentId,Id,LinkedEntityId,ShareType FROM ContentDocumentLink WHERE LinkedEntityId =: IdSet];

0/9000

Hello, I want to create a formula for all second review tasks completed after the due date. When I try to create a formula Task completed date > date, it doesn't work on the summary level and when I try to create the formula on the row level the "date" field doesn't even appear. Any ideas on what I can do to get this formula to work? 

7 réponses
  1. 18 juin, 00:00

    The fact that you have to create a Custom Formula Field that literally just copies the value that is in an existing STANDARD Field, like Task: ActivityDate, just so that you can do the most rudimentary Report Formula.  Because for GodOnlyKnows what reason the STANDARD Field isn't available in STANDARD Activity Report Formulas, never ceases to amaze, befuddle,aggravate, the F*** out of me to no living end.

0/9000

QQ on a formula explanation please:    ABS({!$Record.Amount__c}*{!$Record.Currency__r.USD_FX_Rate__c} / {!$Record.Account_Name__r.USD_Valuation_Total__c}) * 100    Could you please assist?   

2 réponses
  1. 26 mai, 12:46

    Hi @Alex Nis, This formula is calculating the percentage contribution of an objects amount against the Account’s total USD valuation.ABS({!$Record.Amount__c}*{!$Record.Currency__r.USD_FX_Rate__c} / {!$Record.Account_Name__r.USD_Valuation_Total__c}) * 100 

     

    Please see the explanation for the each part in the formula,

    • Amount__c → The current record amount. 
    • Currency__r.USD_FX_Rate__c → Exchange rate used to convert the amount into USD. 
    • Amount__c * USD_FX_Rate__c → Converts the amount into USD value. 
    • USD_Valuation_Total__c → Total USD valuation from the related Account. 
    • / USD_Valuation_Total__c → Finds what portion of the total this record represents. 
    • ABS(...) → Ensures the result is always positive, even if the amount is negative. 
    • * 100 → Converts the decimal into a percentage. 

    Example If Amount is 500 ,  FX Rate is 1.2  and Account Total USD Valuation is 6000 means, It would be,

    (500 * 1.2) / 6000 * 100= 600 / 6000 * 100= 10%

    So the formula returns 10%

     

    Hope this works for you!

0/9000
What is a benefit of developing applications in a multi-tenant environment?

A. Access to predefined computing resources

B. Default out-of-the-box configuration

C. Enforced best practices for development

D. Unlimited processing power and memory
2 réponses
  1. 20 mai, 05:56

    What is a benefit of developing applications in a multi-tenant environment?

    A. Enforced unit testing and code coverage best practices

    B. Access to predefined computing resources

    C. Unlimited processing power and memory

    D. Preconfigured storage for big data 

    Which one is the correct option?

0/9000
Conversion of OST files into Outlook PST is really a tough task and it becomes necessary if your files have been corrupted. In this situation, you will need a converter like ATS OST to PST Converter which has tremendous advantages that help to make the conversion process simple and modest. The user can directly migrate all their database into Office 365 & Live Exchange Server.

Visit here:  https://microsoft-office.wonderhowto.com/forum/best-way-convert-ost-file-pst-file-via-using-ats-ost-pst-converter-tool-0184450/
14 réponses
  1. 19 mai, 13:01

    If you are facing any kind of difficulty with recovering OST files to PST format, then I would like to suggest you to take help of Recoveryfix OST to PST Converter tool. It recovers corrupt OST files & converts them into multiple formats like  PST, DBX, MBOX, MSG, EML, TXT, RTF, HTML, MHTML, PDF, DOC, and DOCX. This OST to PST Converter tool supports all MS Outlook versions like Office 365, 2021, 2019, 2016, 2013 (both 32 bit and 64 bit), 2010, 2007, 2003, 2002, 2000, 98, 97 

0/9000

Hello, I am struggling to get a text formula field to display the corect information.  I have the following formula:     IF( AND(RecordType.Name = 'Asset', CONTAINS( ProductHierarchy__r.NRElement__r.Name, 'Water')),'Yes', 'No')     This is valid syntax, but every record is returning 'No', when there should be 'Yes' also.    I tried:    IF(CONTAINS(ProductHierarchy__r.NRElement__r.Name, "Water"), "Yes", "No")    as well, which was valid, but gave the same unexpected results   

5 réponses
  1. 16 mai, 18:34

    I should point out that the record type I am wanting to display a value against is one ('Site'), but the value/result is coming from 'Asset'.  So, If Site record 'A' contains an Asset Record A, B & C which is water related, then Site record A will contain water.  If Site 'A' doesn't contain any Asset records in it that are water related, then the result will be 'no'. 

    I should point out that the record type I am wanting to display a value against is one ('Site'), but the value/result is coming from 'Asset'.image.png

     

    My thought was I could create a formula lookup on asset record type, and then create another formula to display on site that looked up the value on assets within, but frustratingly salesforce won't let you create formulas looking up other formulas

0/9000