• SteveMo
  • NEWBIE
  • 190 Points
  • Member since 2010
  • Fixer of Shit
  • SteveMoForce


  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 49
    Replies

Hi all,

I'm trying to add a formula as a resource in a Flow and I keep getting syntax errors. It's a really basic formula that will be referenced by an Outcome and is basically going to make the Flow take one of 2 paths depending on whether or not a checkbox on the Account has been checked or not. Many thanks to anyone that can help me. I've already specified the data type to be Boolean and this formula is used in a decision that follows a Get Records element that collects all Account field data from the account record that triggered the Flow.

IF( 
{!Get_Account_Details.Ringfenced__c}, 'True'
)

In my decision element, I'm basically going to end the flow with a message if the checkbox is checked and allow the flow to continue on its path, if the checkbox is unchecked. 

Any other details needed, please let me know.

Thanks in advance,

Matt

User can only move forward and one stage at a time, but be able to skip to "Closed-Lost" from any stage. Another VR dictates that user can only move to "Dead" if prior stage is "IO Signed"

AND(
$Profile.Name <> "System Administrator",
ISCHANGED(StageName) && (
CASE( StageName ,
"Stage 1 - Identified", 1,
"Stage 2 - Discovery", 2,
"Stage 3 - Proposal", 3,
"Stage 4 - Negotiation", 4,
"Stage 5 - Signature", 5,
"IO Signed", 6,
"Closed - Lost", 7,
"Dead", 7,
0)
-
CASE(PRIORVALUE(StageName),
"Stage 1 - Identified", 1,
"Stage 2 - Discovery", 2,
"Stage 3 - Proposal", 3,
"Stage 4 - Negotiation", 4,
"Stage 5 - Signature", 5,
"IO Signed", 6,
"Closed - Lost", 7,
"Dead", 7,0
)*
/*Stages 'Closed - Lost' can be set from any */
CASE( StageName , "Closed - Lost", 7,
0)
<> 1
))
Hello,

I have a formula field with the formula below:

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

I need to separate only the working days between these dates, and put in showing in the field formulates the result, but it is giving the following error

Error: Formula result is data type (Number), incompatible with expected data type (Date).
Hi All,
I have a Validation Rule where all the fields are required 
Picklist( Category__c ), 
Picklist( Course_Name__c ),
Duration_in__c 
Course_Fees__c  ,but one of the Course_Name__c,  Duration is  not Mandatory 

here I have tried 

AND(
 ISBLANK( Category__c ), 
 ISBLANK( Course_Name__c ),
 ISBLANK( Duration_in__c ),
 ISBLANK( Course_Fees__c ) 

OR 

(ISPICKVAL( Course_Name__c  , 'Java')
 && NOT(ISBLANK( Duration_in__c))


Thanks in Advance 

Does anyone know where I can get a list of the metadata API names for system and app permissions defined in .profile files?

 

Salesforce does not seem to publish the API names of the 130+ system and app permissions documented in the "User Permissions" page or the Profile page in the Metadata API documentation. I need the API names so that I can construct metadata files to deploy using the metadata API.

When I try to log in to Trailhead using the "Login Using Salesforce" button in the pop-up I just get kicked into a loop that brings be back to the original Login/Sign Up page, Wash, Rinse, Repeat...    
I've tried all of the Usual Suspects:Chrome, Firefox, Clear Cache, Clear Cookies, have another Beer...  but no luck  :-(  
 
User-added image

 
I keep getting the following error however my button meets all of the requirements and works. 
  • To pass this challenge, create a custom button which opens a link to 'http://google.com/#q={CONTACTNAME}' - where {CONTACTNAME} is the current contact's name. Then add this button to the default 'Contact Layout'.
  • The custom button must be named 'Google Link'.
  • The custom button must be added to the 'Contact Layout' page layout.
Challenge not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: SOLSGVKY
User-added image
 
How to ignore the three months(July, August, september)of 2022 and check Start_Date_TPI__c - TODAY()) < 31 for the upcoming months.
I have a formula that looks at the date ranges of all the Opportunity Products, finds the earliest start date and the latest end date to give the number of months in that term.  However, if the dates are around the begining of the month, sometimes it is off by one.  
 
((YEAR(Latest_End_Date__c) - YEAR(Earliest_Start_Date__c ))*12) + (MONTH(Latest_End_Date__c) - MONTH(Earliest_Start_Date__c ))
So, for example, if the earliest Start Date is 8/1/22 and the end date is 9/30/23, that will show as 13 months.  But if the start date is 8/2/22 and the end is 10/1/23, that is the same number of days but will show as 14.

Both date ranges should return 14 for our calculations, but I am unsure what tweaks to make to the formula to accomplish that.

Any help would be appreciated.
 

Hi all,

I'm trying to add a formula as a resource in a Flow and I keep getting syntax errors. It's a really basic formula that will be referenced by an Outcome and is basically going to make the Flow take one of 2 paths depending on whether or not a checkbox on the Account has been checked or not. Many thanks to anyone that can help me. I've already specified the data type to be Boolean and this formula is used in a decision that follows a Get Records element that collects all Account field data from the account record that triggered the Flow.

IF( 
{!Get_Account_Details.Ringfenced__c}, 'True'
)

In my decision element, I'm basically going to end the flow with a message if the checkbox is checked and allow the flow to continue on its path, if the checkbox is unchecked. 

Any other details needed, please let me know.

Thanks in advance,

Matt

Hello, I want to create a success vs fail percentage of our Assignments, based on a picklist values, called Status. This picklist value Status has up to 8 different statuses.  

For example I want to group Won and Finished records as one group, called "Successes", divide by total assignments to get % of success rate for the assignments.   Then the same thing, for the other statues,call the second group "Fails" to see how many assignments in the success or fails category we have compared to total, to get percentage. To end up getting, 20% success rate, 80% fail rate, out of 250 different assignments created. 

In simple math its basically total of Won + Finished / Total assignments = % success rate then it will be Sent + Lost + any other status / Total assignments = % fail rate.  I have a row level formula that I was able to get to count the "Fails" with this:    
 
CASE(Assignment__c.Status__c,"Sent",1,0) + CASE(Assignment__c.Status__c,"Lost",1,0)

 And I was able to create a "fails percentage" summary formula, that takes the sum of the fails above and divides it by total of records:   
CDF1:SUM / RowCount
 However, how can I create additional row level formulas so I can see % of "fails", as written above, and % of successes.   I feel that in the row formula I need to somehow GROUP them based on picklist values, that some sort of grouping is needed. And in the summary formula column differentiate it somehow.  
 
User-added image
User can only move forward and one stage at a time, but be able to skip to "Closed-Lost" from any stage. Another VR dictates that user can only move to "Dead" if prior stage is "IO Signed"

AND(
$Profile.Name <> "System Administrator",
ISCHANGED(StageName) && (
CASE( StageName ,
"Stage 1 - Identified", 1,
"Stage 2 - Discovery", 2,
"Stage 3 - Proposal", 3,
"Stage 4 - Negotiation", 4,
"Stage 5 - Signature", 5,
"IO Signed", 6,
"Closed - Lost", 7,
"Dead", 7,
0)
-
CASE(PRIORVALUE(StageName),
"Stage 1 - Identified", 1,
"Stage 2 - Discovery", 2,
"Stage 3 - Proposal", 3,
"Stage 4 - Negotiation", 4,
"Stage 5 - Signature", 5,
"IO Signed", 6,
"Closed - Lost", 7,
"Dead", 7,0
)*
/*Stages 'Closed - Lost' can be set from any */
CASE( StageName , "Closed - Lost", 7,
0)
<> 1
))
Hello,

I have a formula field with the formula below:

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

I need to separate only the working days between these dates, and put in showing in the field formulates the result, but it is giving the following error

Error: Formula result is data type (Number), incompatible with expected data type (Date).
Hello all,

 My process builder autocreates an custom object which has lookup relationship. I am trying to populate that relation field with another text field(which hold record Id) using formula . however I get above error message?
How would I update lookuprelationship field  from text field

Thanks
Athi
Hi All,
I have a Validation Rule where all the fields are required 
Picklist( Category__c ), 
Picklist( Course_Name__c ),
Duration_in__c 
Course_Fees__c  ,but one of the Course_Name__c,  Duration is  not Mandatory 

here I have tried 

AND(
 ISBLANK( Category__c ), 
 ISBLANK( Course_Name__c ),
 ISBLANK( Duration_in__c ),
 ISBLANK( Course_Fees__c ) 

OR 

(ISPICKVAL( Course_Name__c  , 'Java')
 && NOT(ISBLANK( Duration_in__c))


Thanks in Advance 
When I try to log in to Trailhead using the "Login Using Salesforce" button in the pop-up I just get kicked into a loop that brings be back to the original Login/Sign Up page, Wash, Rinse, Repeat...    
I've tried all of the Usual Suspects:Chrome, Firefox, Clear Cache, Clear Cookies, have another Beer...  but no luck  :-(  
 
User-added image

 
trying to write a formula to read values from 4 other fields and if they are set to Yes, set this fields value to Yes but am not sure on how to formulate this one.. my mind is drawing a complete blank :(
Hi I want to convert following IF condition to CASE in Formula field. Please Help me out..
IF(( RecordType.Name  = "Business Account") && (BillingCountry  != "CAN"),Text(1000),IF(( RecordType.Name  = "Business Account") && (BillingCountry  = "CAN"),Text(1100),IF(( RecordType.Name  = "Business Account - UK"),Text(1200),IF(( RecordType.Name  = "ETS/WMI") &&   CONTAINS(OwnerId__r.Profile.Name, "ETS"),Text(1500),IF(( RecordType.Name  = "ETS/WMI") &&   CONTAINS(OwnerId__r.Profile.Name, "WMI"),Text(1501),IF(( RecordType.Name  = "Residential Account") && (BillingCountry  != "CAN"),Text(1000),IF(( RecordType.Name  = "Residential Account") && (BillingCountry  = "CAN"),Text(1100),IF(( RecordType.Name  = "Residential Account - UK"),Text(1200),null))))))))
Thanks in Advance.
 
  • November 11, 2015
  • Like
  • 0
I have a standard date field that I would like to use in a formula field to timestamp 3 months out on the 15th of the month. For example. if the date field was in 6/24/15 I want the formula date field to read 9/15/15 (regardless of the number of days in a month).

Any help would be greatly appreciated!

Need formula for pulling CONTACT fields data and mapping it to custom fields in Opportunities

 

Example: I need the CONTACT address, phone, city, state , fax to populate Matching Custom fields in the Opportunity when I use the a custom Opportunity lookup. So if I use the LOOKUP field and Select a Contact it also populated the address, phone....etc in opportunity.

Not really a question, but  solution I thought might be helpful to others:

 

Due to the nature of most backoffice (and frontoffice, for that matter) systems, the standard Address object in salesforce does not work well with integrations, especially if you are using Salesforce.com as the system of record for some addresses.  Most of these systems use a dedicated field for each address line.   We need our street address field to fit into our accounting system limitations, which are:

1. Maxium of 30 characters per line

2. No more than two lines

 

Anyway, the answer for me was some fairly basic Regex for the BillingStreet Field:

NOT(
OR(
REGEX(
BillingStreet,
".{0,30}"
),
REGEX(
BillingStreet,
".{0,30}\r\n.{0,30}"
)
)
)

My regex logic:

Must be:
Empty or Single line less than 31 characters:
.{0,30}
Two lines with less than 31 characters each line:
.{0,30}\r\n.{0,30}

You can also do this with negative enforcement, but the positive model is much cleaner (example shown with 60 character limit instead of 30):

NOT:
2 or more CRLFs
(.*\r\n){2,}.*
More than 60 characters on single line
.{61,}
More than 60 characters on first line of two
.{61,}\r\n.*
More than 60 characters on second line of two
.*\r\n.{61,}

I learned the following about SF regex while doing this:

1. It does not appear to operate in multi-line mode (IE the $ zero-width match does not match the end of each line, just the end of the field)

2. The dot (.) does not match EOL characters (\r and \n)

3. Your regex has to match the entire field - all lines to be true.   In other workds, .* will not match a multi-line field.

4. To match the entire field regardless of the number of lines you would use (.*\r\n){*}

5. SF Address field uses \r\n as their EOL for the purposes of regex (I think this is different than the export, which is supposed to use just \n).

 

Enjoy,

 

Brandy Peterson

Not really a question, but  solution I thought might be helpful to others:

 

Due to the nature of most backoffice (and frontoffice, for that matter) systems, the standard Address object in salesforce does not work well with integrations, especially if you are using Salesforce.com as the system of record for some addresses.  Most of these systems use a dedicated field for each address line.   We need our street address field to fit into our accounting system limitations, which are:

1. Maxium of 30 characters per line

2. No more than two lines

 

Anyway, the answer for me was some fairly basic Regex for the BillingStreet Field:

NOT(
OR(
REGEX(
BillingStreet,
".{0,30}"
),
REGEX(
BillingStreet,
".{0,30}\r\n.{0,30}"
)
)
)

My regex logic:

Must be:
Empty or Single line less than 31 characters:
.{0,30}
Two lines with less than 31 characters each line:
.{0,30}\r\n.{0,30}

You can also do this with negative enforcement, but the positive model is much cleaner (example shown with 60 character limit instead of 30):

NOT:
2 or more CRLFs
(.*\r\n){2,}.*
More than 60 characters on single line
.{61,}
More than 60 characters on first line of two
.{61,}\r\n.*
More than 60 characters on second line of two
.*\r\n.{61,}

I learned the following about SF regex while doing this:

1. It does not appear to operate in multi-line mode (IE the $ zero-width match does not match the end of each line, just the end of the field)

2. The dot (.) does not match EOL characters (\r and \n)

3. Your regex has to match the entire field - all lines to be true.   In other workds, .* will not match a multi-line field.

4. To match the entire field regardless of the number of lines you would use (.*\r\n){*}

5. SF Address field uses \r\n as their EOL for the purposes of regex (I think this is different than the export, which is supposed to use just \n).

 

Enjoy,

 

Brandy Peterson