Blog Posts

Relate an Activity to Multiple Whats

Ever wanted a simple way to add more than one RelatedTo record to an Event? Keep reading.
Relate an Activity to Multiple Whats

Relate an Activity to Multiple Whats

Relate an activity (task/event) to multiple 'Related To' records.  A client of mine recently approached me with this issue.  Not only did she need to be able to relate several contacts to an event in Salesforce, but also multiple records from a custom object.  If your organization has enabled Shared Activities, you can relate as many as 50 contacts to non-recurring and non-group tasks, and non-recurring events, but relating to multiple records of other objects is not available or supported by Salesforce.  

 

This Is Not a New Idea

Here's the latest revival of this idea in the success community.  Here’s another iteration of the same thing, and here's the original idea which was posted 10 years ago, then merged (mistakenly, in the opinion of most) into another idea that was similar but not the same concept.  Needless to say, the idea has been around and continues to be an issue for some Salesforce Users.  

 

An Unreasonable Solution

 It’s likely to occur to many that a combination of custom objects could be used to achieve this functionality from a data model standpoint, but without extensive automation or a fair amount of custom code, including a Visualforce page, the data model will be difficult to maintain.  Such a lengthy addition to the data model for such a small amount of additional functionality also just seemed a bit silly, and after a quick sandbox demo of how this might look, my client required a cleaner, simpler solution.  

The Pseudo Related List (I made that up)

The solution that I came up with doesn’t create a relationship between objects via a lookup field.  It simply captures a name from a lookup and appends it to a long text field on the event object. At the same time, a task is created on the related record referring back to the event. To finish off the process, the lookup field value that was selected is removed in order to allow the addition of further records.  

Now roll up your sleeves. Here’s what you’ll need to replicate the process.

We’ll need to create some custom fields to help us accomplish this, see detail below:

 

Custom Fields

  • Activities   ( In Classic: Setup → Customize → Activities → Activity Custom Fields )

 

Field Name

Field Type

Add to layout

Add New Opportunity

Lookup to Opportunity

Event Layout

Related Opportunities

Text Area

Event Layout

Event/Meeting Link

URL

Task Layout

Event URL

Fomula → text

Non/Hidden

 


 

 

Custom Label

  • This will be used to allow the text area to appear as a list.  It’s actually a workaround for a known issue with line breaks in Process builder formulas.  More info here.
  • Setup → Create → Custom Labels
  • NewLine
  • Value should equal dashes “ - “ on two separate lines

 

Process builder

  • Setup → Create → Workflow & Approvals → Process Builder

 

  • Start the process when an Event record is created or edited

 

 

 

  • Next we’ll create some criteria for appending an Opportunity name to our list.  
  • The AddNewOpportunity__c field should be changed or new and not be null.  We’ll use 3 criteria to set this.   

 

 

 

Field

Operator

Type

Value

[Event].AddNewOpportunity__c

Is Changed

Boolean

True

[Event].CreatedDate

Equals

Reference

[Event].LastModifiedDate

[Event].AddNewOpportunity__c

Does not equal

Global Constant

$GlobalConstant.Null



 

 

 

If these criteria are met, the following actions should occur:

  • Append the opportunity name to the Related Opportunities field by adding an action to update a record.
  • Update the ‘Related Opportunities’ field on the Event that started your process
  • Use the following formula to put each appended name on a new line.

 

[Event].AddNewOpportunity__c.Name &  

SUBSTITUTE($Label.NewLine,"-","")&

PRIORVALUE([Event].Related_Opportunities__c)

 

 

 

 

 

  • Create a Task on the related Opportunity that links back to the Event
  • Add an action to Create a Record of type Task

 

 

 

The last step will be to remove the value from our ‘Add New Opportunity field’  

 

 

  • If ‘Add New Opportunity’ field is not null

 

 

 

  • Make the field null

 

 

Next, make sure to update the process to ‘Evaluate the Next Criteria’ instead of stopping

 

 

 

Be sure to Activate your process.

 

 

Next time you create an event and save it, you can add Opportunities to the “related list” by selecting opportunities in the ‘Add New Opportunity’ field lookup and saving the record.

 

 

Each time you do this, it should add the opportunity name to your ‘Related Opportunities’ field and  leave the ‘Add New Opportunity’ field blank.  

 

 

 

Each of the opportunities you add will also have a task related to them with the subject as the event.

 

 

 

The activity will display in the Activity History of the Opportunity as well.  

 

 

 

 

Other Considerations

 

  • Removing an opportunity name from the list will not remove the related task from the Opportunity. This will need to be done manually.  Automating this would require a fairly complex Apex trigger that would completely defeat the simplicity of this project.
  • Modifying an event date or start time will not propagate through to the created tasks.  Although the link back to the event will still be correct.  Tasks will continue to have original date until updated manually.  
  • Activities reporting should function as expected, given that each Opportunity will have its own activity assigned to it.
  • The use of Opportunities was only for the purpose of this demo.  This process could easily be updated to accommodate any custom or standard object available via lookup.
  • Rich text fields are not available on Activities records.  If the list was to be implemented on an object that allowed this, the names could be inserted as hyperlinks connecting to the related record directly.  
  • Using a lookup field as a point of data entry for an adjacent text field may be confusing, as this is definitely a non-standard way to use Salesforce.  

 

It was my client’s suggestion that I share this as a possible solution for a fairly common problem.  With a little imagination, the concept of a pseudo related list has lots of potential use cases beyond events.

 

Do you have any uses for a pseudo related list like the one I outlined above? If so, tell me all about it. Share them with me on the Arkus Facebook page, in the comments below, in the Success Community, or to me directly via Twitter at @jpbujold

 


Goodies for Admins in the Salesforce Summer 17 Release

I pick out some special Summer ‘17 treats for Salesforce Administrators.
Goodies for Admins in the Salesforce Summer 17 Release

Goodies for Admins in the Salesforce Summer 17 Release

With all the noise about Lightning, Trailhead, and Einstein, it’s good to know that Salesforce is keeping Admins in mind.

It’s the Little Things

I love how the release notes can introduce sweeping changes and tiny details right next to each other. Sometimes things that seem like tiny details have big impact, like these.

Previously the default value for the Global Value Set would be the default value on every field where it was used. Now we will be able to set a different default value at the field level, using formula-defined default picklist values. We can also use this feature to set a different picklist default for different users, which is actually the lead-in use case in the release notes. I’m interested to see what the talented and creative admin community will do with this feature.

I really try, I really do, not to switch back to Classic to work in Setup, but let’s face it, while the organization of Lightning Setup has some strengths, the overall experience for admins can be a little clunky. That’s changing, though. I’m going to breeze over the sweeping changes to Object Manager in Lightning--expect a thorough review in a later Arkus Blog post. As a sneak peek, we’ll also be able to get to it faster. A new little feature that will be a big improvement to Setup in Lightning is the ability to right-click and open more setup items in tabs because no matter how good we are, we still need to cross-reference things sometimes, so we might as well be able to do it quickly.

Communities in the Spotlight

Here’s one I’m really celebrating--Move Communities Between Orgs with Change Sets. There are some awkward limitations, such as the inability to migrate navigational and featured topics, so I hope this is not the last we hear of this development. Another biggie is Upgrade Community User Licenses in a Blink. What was a rather painful multi-step process has been greatly streamlined, so instead of creating a whole new user when we want to go from, say, Customer to Customer Plus, we just edit the user and give them a new license, profile, and role. This is also nicer for the user, as they get to keep their username and password.

Community administration is getting some other detailed attention as well. In Spring ‘17 we got Workspaces, which is clearly where the action is heading because there are some new features that will only be manageable there, including automatic topic assignment. This allows us to assign topics by data category to Knowledge articles for a given community. Also, in Community Builder we now get a dedicated HTML editor component, separate from the rich content editor component, and we can put the language picker component on any page in any template, including login pages.

 

Do you have a favorite admin goodie from the Summer ‘17 release I didn’t mention here? Feel free to comment below, on the Salesforce Success Community, on our Facebook page, or directly at me on Twitter @ifitfloats.

What’s New With Lightning in Summer 17?

Summer 17 is here! Let’s talk about some the newest features added to the Salesforce Lightning Experience.
What’s New With Lightning in Summer 17?

What’s New With Lightning in Summer 17?

Is it me or does it feel like this year is just whizzing right by? Something that popped out to me is that Salesforce seems to be making a move towards efficiency in Lightning, dubbing it as a ‘modern and more intelligent user experience,’ which is nice. Lightning has been improving by leaps and bounds in every release and Summer 17 is no different. Let’s take a look:

Access Field History Related Lists in Lightning Experience

LEX Field History Related List

Ask and you shall receive, right? Organizations will now be able to jump into a record and see the historical changes of the fields over time. This was critical for a lot of organizations out there and I know there are many folks that are very happy about this.

This one was mentioned in Ashley’s Salesforce Summer 17 Ideas Delivered and the previous installment of the Top Ideas saga. The IdeaExchange flexed its muscles and made a strong push over the last few months to get this one delivered. It is always great to see the community getting the things they need in order to make better use of the Salesforce platform.

 

Ditch Your Mouse—Keyboard Shortcuts Are Here

Used in 'What's New With Lightning in Summer 17?' blog

Salesforce is catching up a little bit with keyboard shortcuts. Users now have the ability to search for, edit, save, and close a record. You can also quickly open Notes and post to the feed, all without moving your mouse! I think that this is going to be a great feature that will go a long way towards making Salesforce users more efficient in their day to day workflow. This is a really cool new feature. 

This is a Lightning only feature, so those orgs still working in Classic will have to live without it. If you utilize console navigation, there are extra shortcuts that are available to you to navigate tabs, utilities, and more. You can see the available shortcuts in Windows by pressing Ctrl+/ and in Mac by pressing Cmd+/, try it out! 

If you really enjoy this feature and are interested in other productivity tools or methodologies, there are a lot of articles that have been written throughout the years on the Arkus Blog.

 

Stay on Top of Things with the Updated Activity TimelineUsed in 'What's New With Lightning in Summer 17?' blog

Salesforce continues the trend of efficiency by giving us an updated activity timeline. With the new timeline, you can gain full insight into your past and upcoming activities without having to click into each individual one to view the information. 

Expand one to individually view information on one activity, or expand them all to get a general snapshot of future and completed activities related to the record you are viewing. This is a great new LEX feature that makes working with activities a little easier.

Another really cool capability of this feature is that when you expand an email summary, you can take action on it directly from the timeline.



Drag Files onto Files Related List

LEX Drag and Drop Files

Tired of the sometimes tedious process of manually going through your folders to manually upload them into Salesforce? Wish this could be a little easier? Well, it’s your lucky day. 

Now in Lightning, you can drag files into the Files related list, without having to go through the hassle of the usual manual upload process. Like I said earlier, Salesforce is making a nice push towards efficiency. Drag and drop as many files as you want to, but this new functionality will not work with folders.

This is another Lightning only feature, which is becoming a popular trend. So folks who still favor Classic, it may be time to start jumping on board.

 

Make Lightning Experience the Only Experience

LEX Lightning Only Permission

Are you ready to move everybody in your org to Lightning and never look back? Well, now you have the ability to do this in the Summer 17 release. Admins can now hide the option for their users to switch back to Salesforce Classic. As Salesforce continues to bring Lightning more in-line with Classic and more and more organizations start choosing to utilize the power of LEX, this is going to become a very commonly used permission. Sooner or later, every org will have this little permission box checked.
 

Do you like what Salesforce did with Lighting in the Summer 17 release? Want to share your experiences or thoughts? Let me know what you think on the Arkus Facebook page, in the comments below, in the Success Community, or to me directly via Twitter at @RyanOwensRPO.

 

Contributing To Open Source Projects As a Learning Tool, Part 1

If you’re interested in learning how to code Apex, Visualforce, and Lightning Components, the many open source projects on the Salesforce platform are a great resource. What is Open Source, and how is it used on the Salesforce platform?
Contributing To Open Source Projects As a Learning Tool, Part 1

Contributing To Open Source Projects As a Learning Tool

A few weeks ago, Amy Bucciferro wrote about different learning styles, and how the tools for learning to use, administer, and develop on Salesforce align with certain learning styles. As a largely self-taught coder, I have found the open source projects that members of the Salesforce community have made available an incredible resource. Reading the code and documentation that others have written, and then eventually submitting documentation and code for inclusion in a project, has helped me gain skills and confidence as a developer.

Since even the clicks-not-code parts of Salesforce apps can be stored and shared as text-based metadata, app builders who use these declarative development tools can also gain valuable insights from, and contribute to, open source apps.

What is open source software?

The Open Source Initiative defines the term as "software that can be freely used, changed, and shared (in modified or unmodified form) by anyone."

This means that the source code — the text files used to create a piece of software — are available for anyone, that anyone is allowed to modify that source code, and, if they like, create a new version of the software program. There are a variety of ways that an open source software project can be organized (or not), and a variety of licenses applied to their code, but the bottom line is that the code is available for you to use as you see fit.

Open source software on the Salesforce platform has a couple of attributes that most other platforms don’t. The big one is that the Salesforce platform itself, which is required to use any code written for it, is not open source, and for any real business use, requires paid (or donated) licenses. Another challenge has to do with how apps are packaged and distributed — there are practical pitfalls to taking an app, modifying the code, and installing that code into your Salesforce instance. If you do that, you can’t easily install upgrades that the original app publisher provides.

Finding and installing open source projects

Despite these limitations, just having access to the source code of a Salesforce app is incredibly empowering. This lets anyone who can read code see exactly how the app functions. As an app builder, you can install it into a developer org to see how the Lightning Processes, Flows and Workflow Rules are set up, without having to read any of the code.

There are two main ways that open source software for Salesforce is shared. The first is as an unmanaged package. To install an unmanaged package into a sandbox or developer org, you just need its install link, similar to most other apps you get from the AppExchange. The difference is that you’ll be able to see and modify everything that the unmanaged package adds to your org. However, that editability comes at a price - you can’t upgrade an unmanaged package in-place; you have to uninstall and then reinstall, and uninstalling deletes all the data in any objects or fields that are part of the package.

Dreamhouse Sample AppA great example of an unmanaged package that you can use for learning is Salesforce’s own Dreamhouse App. The Dreamhouse App was actually built to be a tool for demoing and teaching about Salesforce features, and it has lots of declarative goodness if you’re not interested in the code. Salesforce has released several other free and open source tools as unmanaged packages over the years: Action Plans and Milestones PM are particularly well-known ones, and offer great opportunities for learning some code.

The other main way that open source projects for the Salesforce platform are shared is via source code repository sites. GitHub is far and away the most popular site for this, but sites like BitBucket and GitLab can be used as well. Getting the code and other metadata into an org to see how things actually work takes some additional technical steps in many cases — “cloning” the repository onto your local hard drive, and then using one of the IDEs for Salesforce development or the Force.com Migration Tool to deploy the code and other metadata into an org. Fortunately, Andy Fawcett of Financial Force, who has made a lot of contributions to the Salesforce open source community, has provided a Heroku-based tool that helps you to deploy from a GitHub repository (or “repo”) directly into a Salesforce instance. Many Salesforce projects’ GitHub repos feature this button:

Deploy to SF button

which you can click to be linked to Andy’s Deploy to SF Heroku app and install the project. For those projects that don’t offer the button, you can try this Javascript bookmarklet that I built. When you are on the main page of a GitHub repository, you can use the bookmarklet to pass the repo’s URL to the Deploy to SF app.

In the next post, I’ll dig into some of my favorite open source projects, and what specific lessons can be drawn from them.

Do you have favorite Salesforce open source projects that you’ve learned from? Want more details on how to get started with open source code? Share your stories and questions with me on the Arkus Facebook page, in the comments below, in the Success Community, or to me directly via Twitter at @tet3. You can also see my GitHub profile for repositories I’ve starred and forked for my own future learning opportunities.

Photo credit: "16th st" (CC BY-ND 2.0) by Peter McCarthy

Salesforce Summer 17 Ideas Delivered

Salesforce again delivers on Ideas from the Community in the Summer ‘17 release.
Salesforce Summer 17 Ideas Delivered

Salesforce Summer 17 Ideas Delivered

Though the list of ideas delivered in this release isn’t huge (literally it’s 10 ideas) there are some good ideas delivered this time around.  The point count this time is a total of 33,160, not a lot compared to the last release.  Let’s take a look at the Ideas delivered with this latest release:

Lightning Experience

Access Field History Related Lists in Lightning Experience  - Yeah! Tracking field history on standard and custom objects is now visible in Lightning Experience. If you’ve added the related list in classic page layout you will now see it in Lightning (of course you can now add them to the layout in Lightning as well). This idea was delivered with a total of 5020 points.
 
There Are Lots of Shiny New Features for Streams - If you haven’t paid attention to this, Chatter Streams are custom feeds you create by combining multiple related feeds. You can combine feeds from people, groups, and records. In this release, Salesforce has a new home page (click on the Streams heading from the Chatter home page) for them, actions, filters, and you can create up to 100 Streams. The Idea addressed by this feature had gathered a total of 4500 points.

Both Lightning Experience and Salesforce Classic

Lightning for Gmail: General Availability and Improved Efficiency - Most notable of the ideas delivered affecting both Classic and Lightning all revolves around Lightning for Gmail. Generally available in this release, Lightning for Gmail is a Chrome plug in, but first your Administrator needs to perform a few steps to enable in your Salesforce instance--making sure Enhanced Email is enabled for the organization, contacting Salesforce to get access to Enhanced Email for Lightning for Gmail, and enabling the feature. The combined Ideas (Integrate Gmail with Salesforce, Relate Gmail emails to Salesforce, Add Attachments from Gmail to Salesforce) related to Gmail integration on this release is a total of 7,640 points. Here are some of the features worth mentioning:

  • Relate emails to records, as you are composing the email, by selecting relevant accounts, opportunities, cases, or custom objects. The email will be related to the records selected and to relevant contacts, leads, and users associated. 

  • When you’re ready to compose an email, you can select a Lightning email template, modify, and even add merge fields. This capability is in Lightning Experience only.

  • After the initial setup and authentication, Lightning for Gmail saves the user's credentials, so you don’t have to keep logging in each time you want to work in Gmail.

  • Pick and choose which email attachments you want added to records, a very necessary feature, when there are so many images included in signatures out there!

  • With both Lightning for Gmail and Lightning Sync setup you can have your Events synced between Salesforce and Google Calendar. 

  • Not sure if you’ve added that email in Gmail to a Salesforce record? Lightning for Gmail adds labels, so you can tell which emails are already related. You can filter by these labels and assign color coding to them. 


Do you have other favorite Ideas delivered in this latest release I didn’t mention? Please feel free to comment below, on our Facebook page, or directly at me on Twitter @LeiferAshley or in the Success Community and Power of Us Hub.