Tumgik
crmformulas-com · 6 years
Text
calculating weekdays in salesforce
textfixer.com
0 notes
crmformulas-com · 6 years
Text
Calculate weekday count between 2 dates
0 notes
crmformulas-com · 6 years
Text
Formula field to look up text field from a custom object
​how to create Formula field to look up text field from a custom object
0 notes
crmformulas-com · 6 years
Text
Saleforce Button Parameters
How to saveURL, cancelURL, retURL in custom Salesforce button and why.
saveURL, cancelURL and retURL important when you create custom buttons.
A Salesforce page renders with a specific URL that can look like this:
https://cs19.Salesforce.com/001L000000iNUCrIMO/e?retURL=%4F001L000000iNUCrIAX
https://cs19.salesforce.com/ — the salesforce domain name with the subdomain, cs19, being the specific server instance that your org's footprint is hosted on. If you have integrated SSO credentials then your subdomain can be custom named via the following context, https://customS
001L000000iNUCrIAO — the account record id
/e — the action for the record, e stands for edit in this case from salesforce
? … — everything after the ? is the query string, which begins with a ? and is & delimited with key = value pairs, e.g. ?a=b&c=d&e=f, we have 3 variables being set: a which is set to b, c which is set to d and e which is set to f
so here a is a key and b is a value.
retURL=%2F001L000000iNUCrIAO – the URL you want to redirect the user to when he clicks CANCEL Button. %2F denotes a ‘/’ and the merge field {!Account.Id} gives the Account to redirect to after clicked the Cancel Button
saveURL – similar to retURL except that it defines the URL to redirect to after the user clicks ‘SAVE Button’.
Save button is as follows:
Is there a saveURL URL parameter set? If so, redirect to that.
Is there a retURL URL parameter set? If so, redirect to that.
Redirect to /home/home.jsp
Note: The behavior is slightly different if we’re creating a new record.
Cancel button is as follows:
Is there a cancelURL URL parameter set? If so, redirect to that.
Is there a retURL URL parameter set? If so, redirect to that.
Redirect to /home/home.jsp
When saving a new record, you can use the saveURL parameter:
{!URLFOR($Action.Contact.NewContact, c.id, [‘saveURL’=’/home/home.jsp’])}
When editing an existing record, you can use the retURL parameter:
{!URLFOR($Action.Event.Edit, c.id, [‘retURL’=’/home/home.jsp’])}
0 notes
crmformulas-com · 6 years
Text
Force validation rules
How to force validation rules for formula-based buttons
0 notes
crmformulas-com · 6 years
Text
retURL vs saveURL? When and how to use
0 notes
crmformulas-com · 6 years
Text
Salesforce retURL not working
Salesforce retURL not working?
0 notes
crmformulas-com · 6 years
Text
Date formats in Formula
How to change TODAY() date formats in Formula to reflecr MMDDYYYY
0 notes
crmformulas-com · 6 years
Text
SOQL queries in Salesforce formulas
How to write SOQL queries in Salesforce formulas.
0 notes
crmformulas-com · 6 years
Text
Multivariable CASE
How to nest in multiple variables into an IF or a Case formula
0 notes
crmformulas-com · 6 years
Text
Salesforce Formulas to Concatenate
Concatenation example: “OpportunityClosed_Date__c-” & Opportunity_Name & “-” & Opportunity_Amount When you Concatenate what you’re doing is joining fields, expressions, and values into a standard common string.
0 notes
crmformulas-com · 6 years
Text
= and == (Equal) vs. ISBLANK
In writing Salesforce formulas, = vs. == are interchangable. However, if you’re looking for a NULL then do not use them. Instead use ISBLANK ().
IF(Probability =1, ROUND(Amount*0.02, 2), 0) This formula calculates any opportunity whose probability is at 100% (=1) & calculates the Opportunity Amount, (Amount) by multiplying by 0.02 to gain the 2% commission rate. Otherwise, every other opportunity has a commission value of 0. Notice the placement of the parenthesis.
0 notes
crmformulas-com · 6 years
Text
Salesforce Hyperlink Formula Syntax
Hyperlink formula fields are Text Type.
Always include the web protocol and the URL in quotes, followed by the its labeling text  HYPERLINK("http://www.salesforce.com", "salesforce").
When you’re hyperlinking to actual Salesforce pages, we call this the URI, or relative URL, simply because you are not writing out the full web protocol and URL. Instead, exclude your Salesforce’s instance’s value and the trailing .salesforce.com, instead input only what comes after the .com. For example, https://yourInstance.salesforce.com/00Z/a, then the URI to include is actually just “/00Z/a”. Relative links allow the hyperlink to work correctly on all Salesforce pages. Use the relative URL in a hyperlink formula to add it to a search layout. Make sure to include forward slash at the start of your URI.
Avoid using  LEN, LEFT, or RIGHT on HYPERLINK text functions results.
No JavaScript can be included for security reasons.
Use the $Api variable to reference API URLs.
Remove the brackets, [ ], from your formula before validating it.
The target parameter is optional. If you do not specify a target, the link opens in a new browser window.
Target paremeters: _blankDisplays go in a new unnamed window. _selfDisplays go in the same frame or window as the element that refers to it. _parentDisplays go in the immediate frameset parent of the current frame. This value is the same as _self if the current frame has no parent. _topDisplays go  in the full original window, canceling any other frames. This value is the same as _self if the current frame has no parent.For more information on basic HTML tags, consult an HTML reference on the Internet.
0 notes
crmformulas-com · 6 years
Text
Hyperlink Formulas
HYPERLINK("/00U/e? retURL=%2F006x0000001T8Om&what_id=" & Id, "Create Event")
Salesforce hyperlink formula example above is a HYPERLINK(url, friendly_name [,target]) and replace url with the Web address, replace friendly_name with the link text, and, optionally, replace target with the window or frame in which to display the content. The URL in this case is actually the URI for Salesforce.
0 notes
crmformulas-com · 6 years
Text
Text Validation to verify Web Site Extension
Sample Salesforce formula below shows lookup to validate that the last 4 digits to an inputted website are correctly matched to specific variations of domain extensions. Remember that formulas are case-sensitive so therefore we have to account for all of the variations. in this case we left out “.Com” vs. “.Org” vs. “.Net” variations so you can add them as needed. 
AND( RIGHT( Web_Site__c, 4) <> ".COM", RIGHT( Web_Site__c, 4) <> ".com", RIGHT( Web_Site__c, 4) <> ".ORG", RIGHT( Web_Site__c, 4) <> ".org", RIGHT( Web_Site__c, 4) <> ".NET", RIGHT( Web_Site__c, 4) <> ".net", RIGHT( Web_Site__c, 6) <> ".CO.UK", RIGHT( Web_Site__c, 6) <> ".co.uk" )
0 notes
crmformulas-com · 6 years
Text
Enforce Numerical Formats
Salesforce Formula Sample below enforces specific formats for inputted numerical values. Example 1 Salesforce Sample Formula to enforce  social security number format.
NOT( OR( ISBLANK(Social_Security_Number__c), REGEX( Social_Security_Number__c , "[0-9]{3}-[0-9]{2}-[0-9]{4}") ) )
Logic: Three single digits (0-9):\\d{3} • A dash • Two single digits (0-9):\\d{2} • A dash • Four single digits (0-9):\\d{4} Example 2 Salesforce Formula Example to enforce credit card number format.
NOT( REGEX( Credit_Card_Number__c , "(((\\d{4}-){3}\\d{4})|\\d{16})?")) Logic: Four digits (0-9) followed by a dash: \\d{4}- • The aforementioned pattern is repeated three times by wrapping it in () {3} • Four digits (0-9) • The OR character (|) allows an alternative pattern of 16 digits of zero through nine with no dashes: \\d{16} Example 3 Salesforce formula to enforce IP address format. NOT( REGEX( IP_Address__c, Formula: "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.) {3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" ))
0 notes
crmformulas-com · 6 years
Text
Sample Salesforce Formula below enforces a check-box action before a User can continue on with value input to another field. In Salesforce example below, we use the “I accept conditions” as the box that needed to be checked first before the user can proceed.
AND( NOT( I_accept_conditions__c ), Number_of_Days__c > $User.PTO_Balance__c )
0 notes