• SteveMo__c
  • NEWBIE
  • 280 Points
  • Member since 2010
  • Fixer of Shit
  • SteveMoForce


  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 60
    Replies
checkbox should be checked if the logged in user sales org and Product Sales org matches. sales org is picklist feild in user object and multislect feild in product object . i have written below formula but getting error
formula :
IF($User.Sales_Org__c = Sales_Org__c , true, false)

error : 
 Error: Field Sales_Org__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
I am creating reports and I need to get the user role however I'm not sure what the best way would be to get the role of a user in a user field.

I. E. I have a user field with John Smith, how do I pull in John Smith's role? This is not the contact owner but a user field which is a lookup field.

Thanks,
I need to substring data from a field to insert into an Row-Level formula on a report. Example of the field's data looks like this:

"Tom Smith time of 600s on 2022-10-04"

This is the field name: LWCCaseTimer__Session_Time__c.Name

How would I substring out the name "Tom Smith" before the position of the word "time"? The length of the name in the field can be different for each record.

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
 
checkbox should be checked if the logged in user sales org and Product Sales org matches. sales org is picklist feild in user object and multislect feild in product object . i have written below formula but getting error
formula :
IF($User.Sales_Org__c = Sales_Org__c , true, false)

error : 
 Error: Field Sales_Org__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
I am creating reports and I need to get the user role however I'm not sure what the best way would be to get the role of a user in a user field.

I. E. I have a user field with John Smith, how do I pull in John Smith's role? This is not the contact owner but a user field which is a lookup field.

Thanks,
I feel like, despite searching and eliminating some options, I must be overlooking something that would make this a much cleaner formula in 2023. This State/Province is a picklist field, and if any of the following are selected on the parent record it drives this IF statement. This way of writing it WORKS and passes, but it's so prehistoric. Is there a better way yet?

IF(
AND(
SBQQ__ProductCode__c = '734000',
OR(
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'TX'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'VA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'KY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NJ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'SC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'FL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'GA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'OK'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'MI'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CO'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AZ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'UT')),
Dist_Test_Price__c < 16.50),
"Requires Exception",
"Pass")
Hello guys,
I need your help to create a validation rule I've tried everything and I can't, the rule is as follows:

Create a validation rule on the Price Request object that does not allow you to change the Price Request status from "Unsolicited" to "Requested" in the "Order attached?" left equal to False. Rule logic:
"Status" field has been changed;
Field “Status” equal to “Requested”;
Field "Request attached?" equals False;
Error Message: The MS Excel Request File Was Not Attached.

When I tried to do it, I also got an error:
Error: State_CHI__c field is a picklist field. Picklist fields are only supported in certain roles

Can you help me? Thanks!
Hi All, 

I have new date/time field (datefield1)
I have picklist field (values = support and service)
I have existing date field called stampfield

Scenario is:
when picklist value 'support' is selected: my new date filed should calulate stampied time + 1 hour

when picklust calue 'service' is selected: my new date field should calculate stamped time filed +24 hours

How do I acheive this? Please suggest
I need to substring data from a field to insert into an Row-Level formula on a report. Example of the field's data looks like this:

"Tom Smith time of 600s on 2022-10-04"

This is the field name: LWCCaseTimer__Session_Time__c.Name

How would I substring out the name "Tom Smith" before the position of the word "time"? The length of the name in the field can be different for each record.
Hi All! 

I feel like I've searched everywhere and haven't seen an answer to this situation. So I was hoping for some help. What I am trying to do is prevent editing (locking down) of the Key Fields in the different opportunity stages once an opportunity stage is progressed. So if you progress from stage 1 to stage 2, it locks down the Key Fields in stage 1. If they want to edit the Key Fields, they must regress to the specific opportunity stage where the key fields are. My opportunity stages are listed below:

1) Qualification Needed
2) Interest
3) Evaluation
4) Proposal/Price Quote
5) Developed 
6) Procurement 
7) Closed

Any help would be awesome! Thanks!
 
I'm creating VR on opportunities with conditions as below but getting error, please suggest the one VR to include all below conditions  :

Opportunities with field Type = Advance Stock field Stock Approval = (“Stock/POS (Standard)” OR “Stock/POS (Discounted)”)

Opportunities with field Type = Consignment Stock, field Stock Approval = (“Consignment & Demo”)

Opportunities with field Type = POS field Stock Approval = (“Stock/POS (Standard)” OR “Stock/POS (Discounted)”)
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
))
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!
I've got a report I am trying to write and I need to use one or other of Prev/Parent Group Val custom formlae I think.  I've read the SFDC help and resources on this forum but still can't get my head around what I need to do to get this to work.

I have a matrix report Accounts with Orders and Products.  Orders is a cusom object called Order.

Account has a custom field called Region__c which is a pick list and represents the region that an account is in.
Order has a custom field called X9L_Equiv__c which reprents the 9 litre equivalent of an order.  We're talking alcohol here - the 9L= of a 12 x 750ml case of Gin is 1: the 9L= of a 6 x 500ml case of Cherry Vodka is 0.33.  An order containing 6 cases of Cherry Vodka would have a Count of 1, Quantity of 6, 9L= of 2.  Hopefully I've clarified not complicated!

My matrix report is like this:

                    MONTH 1                                         MONTH 2                                  Grand Total
Region         Gin      Cherry Vodka        Total       Gin      Cherry Vodka     Total    GT
London           2             5                         7           6               4                   10        17
South                             3                         3           2               5                     7        10
North              8             1                         9            3                                     3         12
GRAND TT   10            9                        19          11              9                   20        39

What I'd like is
                     MONTH 1                                         MONTH 2                                  Grand Total
Region         Gin      Cherry Vodka        Total       Gin      Cherry Vodka     Total    GT
London          5%            13%                   18%     15%               10%          26%      44%
South                               8%                      8%       5%               13%          18%      26%
North              21%            3%                   23%                             8%            8%      31%
GRAND TT   26%          23%                     49%    21%              31%            51%    100%

I cannot figure out the syntax of the two formulas in respect of referencing fields that I want to group by.

PARENTGROUPVAL(Order__c.X9L_Equivalent_of_Order__c:SUM, ACCOUNT.REGION__c, PRODUCT.NAME) gives me a field does not exist error on ACCOUNT.REGION__c

Hope this makes sense and someone can help me.
Thanks

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