Visualforce PageMessage Samples

Chad SmithApex, Visualforce

I can never remember what the different Visualforce page message options look like between the severity and strength so here are the options along with the code.

Quick Tip for Filtering List Views and Multiple Values

Chad SmithList Views

Let’s say you want to view a list of all of your accounts in the midwest. You might be tempted to create a set of ‘or’ filters for State = WI or State = IL, etc. However, you can simply separate the values with commas to get results much quicker.

NewImage

Visualforce Date Popup

Chad SmithVisualforce

If you work with Visualforce and the first field on your page is a date you’ll notice that when the page loads it’ll automatically open the date picker which is often not desirable. To fix this simply place this Javascript on your page:

<Script>
function setFocusOnLoad() {}
</Script>

Salesforce Summer ’16 Preview – Account Autofill & Account Logos

Chad SmithSummer '16

Here are a couple of new features that I think those of us have to enter data into Salesforce or just use accounts will appreciate.  Once an administrator enables Account Autofill & Account Logos in Setup.

Salesforce Summer 16 Account Logos and Autofill 1

When entering a new Account Salesforce will give you a list of suggestions:

Salesforce Summer 16 Account Logos and Autofill 2

As well, phone numbers and web sites for some of the businesses will also automatically be populated for you. You’ll notice some of the accounts also have an associated logo, so once in Salesforce you’ll see the company logo next to the name.

Salesforce Summer 16 Account Logos and Autofill 3

Salesforce Summer ’16 Preview – Associate a Contact to Multiple Accounts

Chad SmithSummer '16

This has been a feature request for quite some time now, and we’ve finally got it!  Your administrator will need to enable, “Allow users to relate a contact to multiple accounts” in the org but once that’s done, you’ll be able to add the new related lists on your Accounts & Contacts.

… and yes, this feature is available in Lightning & Classic!

On your contact records you’ll have a new related list for Related Accounts.

Salesforce Contacts to Multiple Accounts 1

The contact’s primary relationship will be specified as direct.  There’s a new objects and page layout to support this new relationship where an administrator can add and remove role options, create custom fields, and set page layouts.

Salesforce Contacts to Multiple Accounts 2

Accounts have a new related list as well, Related Contacts, which show standard contacts, specified as Direct as well as contacts related to the account via a non-direct relationship.

Salesforce Contacts to Multiple Accounts 3

All in all, this will be a nice feature to avoid having to create duplicate contacts in your system if you need to track the same contact related to multiple accounts.

How to keep just one (or a few) Accounts Private in Salesforce

Chad SmithSalesforce Tips

Salesforce’s security model is pretty flexible, but it’ll take a little (but not too much) work if you want to set it up so all of your accounts are publicly available except for a few.

First, create a new check box field called ‘Private’.  If an account should be private then we’ll check this button.  You may want to control field level security (FLS) so only admins can read and/or update the field.

Private 1

Next, we’ll set the Organization-Wide Default for Account Security to private.  This is done under Setup | Security Controls | Sharing Settings.

Finally, create an Account Sharing Rule that makes non-private accounts available for Read/Write, then the appropriate access for Contracts & Cases.

Private 2