• the1castdown
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I created 2 custom formula fields, one for calculating the case creation time as a number and one for calculating the day of the week in which the case was created.  I needed these to create assignment rules based on time of day and day of the week.
 
The Creation Time is calculated in Military time, because the formula I wrote to figure out the standard time was too many characters. This is the formula for a Custom Field that returns numbers with 2 decimal places:
 
VALUE (TEXT (IF (
VALUE (MID (TEXT (CreatedDate),12,2)) - 7 <= 0,
VALUE (MID (TEXT (CreatedDate),12,2)) - 7 + 24,
VALUE (MID (TEXT (CreatedDate),12,2)) - 7
)) & "." & MID (TEXT (CreatedDate),15,2))
 
My concern is that this formula won't be correct when we leave daylight savings time.  Any ideas how to take daylight savings into consideration? 
 
For the day of the week, I used I function I found somewhere on the dev network.  It looks like this:
 
CASE(
MOD( TODAY() - DATE(1900, 1, 7), 7),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
6, "Saturday", "Error")
 
I guess I'm looking for a solution to the daylight savings time problem, or a better way to create assignment rules based on day of the week and time of day.
*I posted this once already and it got deleted, I have no idea why. This is a legitemate question, If I posted in the wrong place, please message me to tell me the correct place to post.*
 
I started creating a custom button to appear in the details section of cases.  I want the button to go to the "Send an Email" page if it is the first time responding to a support case, but I would like it to go to "Email Messages for Case" page if a reply Email for the support case has been sent.  I got this to work using 2 different buttons with the following code:
 
"Send an Email" button
http://na3.salesforce.com/email/author/emailauthor.jsp?p2_lkid={!Case.ContactId}&p3_lkid={!Case.Id}&p24={!Case.SuppliedEmail}
 
"Email Messages for Case" button
https://na3.salesforce.com/ui/email/EmailMessageListPage?id={!Case.Id}
 
To put these functions in the same button I figured I'd have to use an IF statement that could check to see if emails have been sent or not.  The best solution I came up with thus far:
 
http://na3.salesforce.com/
{!IF( Case.CreatedDate >= Case.LastModifiedDate,
"email/author/emailauthor.jsp?p2_lkid=" & Case.ContactId & "&p3_lkid=" & Case.Id & "&p24=" & Case.SuppliedEmail,
"ui/email/EmailMessageListPage?id=" & Case.Id)}
 
Believe it or not, that code actually works, except for the fact that every "/" inside the IF statement is changed to %2F as well as the"?" which is changed to its HTML equivalent. I've seen that browsers can interpret escaped characters correctly, but for some reason it doesn't work for my function.  If I use URLs without forward slashes or question marks the function works great. Any help on this problem as well as a better idea on how to check if Emails activity has occured would be great.
 
If this seems like a bad solution for making my salesforce case work more user friendly, I'm open to any ideas.
 
Unless I decide this is the wrong approach for providing better case workflow, I plan to add functionality that applies a support email template to the first Reply email for a support case.    
I started creating a custom button to appear in the details section of cases.  I want the button to go to the "Send an Email" page if it is the first time responding to a support case, but I would like it to go to "Email Messages for Case" page if a reply Email for the support case has been sent.  I got this to work using 2 different buttons with the following code:
 
"Send an Email" button
http://na3.salesforce.com/email/author/emailauthor.jsp?p2_lkid={!Case.ContactId}&p3_lkid={!Case.Id}&p24={!Case.SuppliedEmail}
"Email Messages for Case" button
https://na3.salesforce.com/ui/email/EmailMessageListPage?id={!Case.Id}
 
To put these functions in the same button I figured I'd have to use an IF statement that could check to see if emails have been sent or not.  The best solution I came up with thus far:
 
http://na3.salesforce.com/
{!IF( Case.CreatedDate >= Case.LastModifiedDate ,
"email/author/emailauthor.jsp?p2_lkid=" & Case.ContactId & "&p3_lkid=" & Case.Id & "&p24=" & Case.SuppliedEmail ,
"ui/email/EmailMessageListPage?id=" & Case.Id )}
 
Believe it or not, that code actually works, except for the fact that every "/" inside the IF statement is changed to %2F as well as the"?" which is changed to its HTML equivalent. I've seen that browsers can interpret escaped characters correctly, but for some reason it doesn't work for my function.  If I use URLs without characters that change to their HTML equivalent, such as www.yahoo.com or www.amazon.com the function works great. Any help on this problem as well as a better idea on how to check if Emails activity has occurred would be great.  If this seems like a bad solution for making my salesforce case work more user friendly, I'm open to any ideas.
 
Unless I decide this is the wrong approach for providing better case workflow, I plan to add functionality that applies a support email template to the first Reply email for a support case.    
I started creating a custom button to appear in the details section of cases.  I want the button to go to the "Send an Email" page if it is the first time responding to a support case, but I would like it to go to "Email Messages for Case" page if a reply Email for the support case has been sent.  I got this to work using 2 different buttons with the following code:
 
"Send an Email" button
"Email Messages for Case" button
 
To put these functions in the same button I figured I'd have to use an IF statement that could check to see if emails have been sent or not.  The best solution I came up with thus far:
 
http://na3.salesforce.com/
{!IF( Case.CreatedDate >= Case.LastModifiedDate ,
"email/author/emailauthor.jsp?p2_lkid=" & Case.ContactId & "&p3_lkid=" & Case.Id & "&p24=" & Case.SuppliedEmail ,
"ui/email/EmailMessageListPage?id=" & Case.Id 
)}
 
Believe it or not, that code actually works, except for the fact that every "/" inside the IF statement is changed to %2F as well as the"?" which is changed to its HTML equivalent. I've seen that browsers can interpret escaped characters correctly, but for some reason it doesn't work for my function.  If I use URLs without characters that change to thier HTML equivalent, such as www.yahoo.com or www.amazon.com the function works great. Any help on this problem as well as a better idea on how to check if Emails activity has occured would be great.  If this seems like a bad solution for making my salesforce case work more user friendly, I'm open to any ideas.
 
Unless I decide this is the wrong approach for providing better case workflow, I plan to add functionality that applies a support email template to the first Reply email for a support case.
 
 
*I posted this once already and it got deleted, I have no idea why. This is a legitemate question, If I posted in the wrong place, please message me to tell me the correct place to post.*
 
I started creating a custom button to appear in the details section of cases.  I want the button to go to the "Send an Email" page if it is the first time responding to a support case, but I would like it to go to "Email Messages for Case" page if a reply Email for the support case has been sent.  I got this to work using 2 different buttons with the following code:
 
"Send an Email" button
http://na3.salesforce.com/email/author/emailauthor.jsp?p2_lkid={!Case.ContactId}&p3_lkid={!Case.Id}&p24={!Case.SuppliedEmail}
 
"Email Messages for Case" button
https://na3.salesforce.com/ui/email/EmailMessageListPage?id={!Case.Id}
 
To put these functions in the same button I figured I'd have to use an IF statement that could check to see if emails have been sent or not.  The best solution I came up with thus far:
 
http://na3.salesforce.com/
{!IF( Case.CreatedDate >= Case.LastModifiedDate,
"email/author/emailauthor.jsp?p2_lkid=" & Case.ContactId & "&p3_lkid=" & Case.Id & "&p24=" & Case.SuppliedEmail,
"ui/email/EmailMessageListPage?id=" & Case.Id)}
 
Believe it or not, that code actually works, except for the fact that every "/" inside the IF statement is changed to %2F as well as the"?" which is changed to its HTML equivalent. I've seen that browsers can interpret escaped characters correctly, but for some reason it doesn't work for my function.  If I use URLs without forward slashes or question marks the function works great. Any help on this problem as well as a better idea on how to check if Emails activity has occured would be great.
 
If this seems like a bad solution for making my salesforce case work more user friendly, I'm open to any ideas.
 
Unless I decide this is the wrong approach for providing better case workflow, I plan to add functionality that applies a support email template to the first Reply email for a support case.