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


  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 42
    Replies
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
 
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

 
Hi, 

 There are two field on a object called quote field names are 
  
 Quote_Expired__c  (Checkbox) 
  ExpirationDate  (date)

When Quote_Expired__c   = True user should not able to edit or make any changes to ExpirationDate   Please suggest me how to write a validation for this condition 

Thanks
Sudhir
   
I'm trying to create a report summary formula where, instead of dividing by RowCount, I want to divide by only non-null rows.
My current formula is:
(Survey_Results__c.CS1_ABC_Category__c:SUM/RowCount)

I need to only count rows that are non-null.

Thanks.
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 field that returns the number of business days in the current month as of today.
I have date fields on each user for User Start Date and User End Date.
I want to be able to calculate the number of business days for the user and take into consideration the possibility that she started sometime after the first day of the month, or ended before the last day of the month.

Here is my current formula that does not consider the start or end dates. I have a -1 in the formula because our time tracking runs every day at 5 AM for all days up to the prior one (not current day)

CASE(MOD( DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) - DATE(1985,6,24),7),
0 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+
(FLOOR(( (TODAY()-1) - DATE(YEAR(TODAY()-1),MONTH(TODAY()-1),1) )/7)*5)
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!
Hello,

I have a field Charging_Date__c..

Thru front-end validation rule, can i create a validation rule using that will raise an error message if the date entered is not on the first week of the next month?

Or this should be done somewhere else apex?

thanks,
Del
Hi all, I'd like to have a formula field that populates with a name based off of the zip code on a Contact record.  The idea is that a Senator or Legislator name would be populated based off of a zip code.  I'm imagining something like a VLookup in Excel, but in Salesforce.  It's out of the question to write a huge nested conditional formula to pull the info.  Is there any way to store something in Salesforce that can be updated, that a formula field can reference to pull information from, similiar to an excel VLookup?

Thanks!

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