Category: Salesforce

  • Salesforce Objects and URL Hacking

    Salesforce Objects and URL Hacking

    What is Salesforce URL Hacking? I’ve been curious about how Saleforce Objects are setup up in reference to the URL format, and see if users and admins are able to make custom URL “Hacks” that can be quick actions to save time for your users . Some use cases I’ve since developed solutions for are creating and closing records like tasks & cases, easily creating a contact & opportunity with pre-populated fields,  or even passing parameters through the URL based on field values of an account to generate custom reports. Before we go into that, I’d like to provide the basics of what URL hacking is and how we can use it in Salesforce.

    PLEASE NOTE: URL Hacking is not supported by Salesforce, and the URL format can be subject to change without announcement. Situations like enabling Lightning require you to enable the My Domain feature and possibly instance migrations can affect the URL schema. Salesforce has created Quick Actions you can create in response to this technique. Do this at your risk!

    Salesforce URL Hacking Overview

    This all started with how most of my understanding of Salesforce functionality starts – a user requests a specific requirement, and I figure out how to solve their need. Unfortunately, I exhausted all of my resources, and turned to Salesforce support. As it turns out, what I was doing was not supported, and couldn’t get additional assistance from them. You can view the response from Salesforce Support below:

    Response Salesforce Support Url Hack

    I was very curious now, and wanted to explore more about URL hacking, and how I can leverage it to solve specific business requirements from my users. First, we’ll go over the basics of URL hacking:

    URL Hacking and Salesforce Objects

    First we’ll start off by seeing how the base URL is formed in Salesforce. We have the basic Salesforce url here: http://XXXX.salesforce.com/ , where XXXX is your Instance of Salesforce (server location), or your My Domain (if it had been setup). Typically, anything after the backslash  (the ‘/‘) after .com is where the salesforce objects and record IDs live, as well as the HTTP request parameters.

    For each record, they are typically 16 digit or 18 digits long after the instance url – so http://na33.salesforce.com/XXXXXXXXXXXXXXXX. The first 3 digits after the backslash will typically represent the object that is referenced.

    Here are some of the Salesforce Standard Object types that I’ve found and have access to:

    00O (zero zero Oh) = Reports
    001 = Accounts
    002 = Notes
    003 = Contacts
    005 = Users
    006 = Opportunities
    007 = Activity History
    00T = Tasks
    00U = Calendar
    00P = Attached File
    00Q = Leads
    500 = Cases
    501 – Solutions
    800 = Contracts
    01T = Products
    01Z = Dashboards
    015 = Documents
    701 = Campaigns
    a0F = Customer References
    a0G = Campaign Groups
    0BM = Connections

    This list is not comprehensive & does NOT include any objects that can be added by an installed/managed package, or other objects that you’ve created and are “Custom Objects”. Each of these Objects will each have their own unique Salesforce three-digit Object Code. (If you know of any other Object record IDs, please share them with me).

    Now, comes the interesting part. An opportunity will follow this ID code: 006XXXXXXXXXXXXX. If you are a smaller org, it will look something like 0060000000000002xWh, representing a single Opportunity record. For some objects (not all!), to find the new or edit page, the URL structure that just follows the object URL reference with a blackslash and an ‘e‘ after.

    In the opportunity example, http://na33.salesforce.com/006/e would be a new opportunity edit page on the na33 Salesforce instance.

    In HTML, the GET method can be pushed through the URL by appending a ‘?‘. In the case of creating a contact, it would look something like:

    http://naXX.salesforce.com/003/e?retURL=0010000000XXXXXX

    In this case, we have the Salesforce URL followed by 003/e, or the Contact’s Edit page, with the retURL meaning what URL you will go back to once you click Save or Cancel.

    To create a contact, we’d want to pass over parameters like the retURL, or Return URL, the Record Type of the contact, and the Account ID (accid) as well. That would look something like:

    https://na33salesforce.com/003/e?retURL=%2F00100000002Tv8c&accid=00100000002Tv8c&RecordType=0120000000000AR&ent=Contact

    The & in the above is how you can string parameters together in the GET request.

    Sending parameters through the Salesforce URL

    Let’s take the Task object in this example.

    Salesforce Tasks tasks are the URL code – 00T

    So /00T/e – will let us set the task edit page.

    We’ll then string the GET request by adding a ? after the e.

    So far, so good – we’re at /00T/e?

    And now, for Tasks, we have to figure out what each field on the Task object does based on the URL GET parameter.

    For Tasks, here are just some of the parameters we can pass (I will go in more detail in a later post):

    tsk1= Who is the Task Assigned to?
    tsk2= What is the Related Contact ID?
    tsk3= What is the Objects name
    tsk4= What is the Due date
    tsk5= What is the Subject
    tsk12= What is the Task’s Status
    retURL= Where to return when saved

    Here’s a basic example situation for the URL Hack use case that we can create:

    An unknown person calls the Main Sales line, and an inbound Sales user wants to quickly open a new Task from any page in Salesforce to get ready to jot down notes about the conversation. To do that, the user can click on a custom link (that we will create) located on the sidebar, that will have the Subject (tsk5) set to “Call: Sales Line” and have the Status (tsk12) be “Completed”. The Custom Link URL structure would look like:

    /00T/e?&tsk5=Call:%20Sales%20Line&tsk12=Completed

    This will allow them to quickly update the Task’s Comments section of the call, and associate the task with a Contact or Opportunity if existing already in the CRM. To do this, you would go to the Custom Links section in setup, and create this custom link to add to the sidebar. (Article will go here when completed!)

    You could of course add on to the above URL schema to string other parameters to pass through and save with the Task record that the link creates.

    Creating URL Hack in Salesforce

    So how can we implement this for our users in Salesforce? As seen above in the Task use case, we can create a custom link that allows a user to quickly populate the Status and Subject fields of a task, where they can write some notes quickly, with less clicks, and by able to focus their attention to the prospect.

    For many use cases, I’ve implemented Custom Links on the Sidebar or Custom Buttons & Links above an Object’s record (on the page layout) to perform these actions.

    In future articles, I’ll showcase and walk-through some of the URL hacks I’ve personally created. These include populating Reports based on the Account record the link on the page layout is clicked,  being able to fulfill tasks & cases quickly (more of the above), and being able to quickly create certain contacts or opportunity types to save time for your users.

    Have you created custom URL hacks for your Salesforce Org? What are your thoughts on the future of URL hacks and migrations to Quick Actions? Share with us in the comments below!

  • Why is the Salesforce Opportunity Amount Field Locked?

    A common question that I’ve been asked by a few users over the years – why is the Salesforce Opportunity’s Amount field locked? When I was just learning Salesforce, it made no sense to me. Every opportunity that I’ve encountered could have the Amount field entered in ad hoc as a number field. In the scenario I was presented, it had a ‘locked’ button when there usually was meant to be a pencil, meaning I can edit. I’ve recently been asked this from a User, and here is a recent screenshot I’ve received:

    Opportunity Amount Field locked in Salesforce

    I figured I’d write up an article to explain why an Opportunity Amount field is Locked. Usually, what I do is ask the User to send over to me the URL of the Salesforce record they have an inquiry on.

    In these situations, an initial thought is always – was the record locked due to being within an approval process? I looked at the opportunity’s approval history and saw that it wasn’t being sent through an approval, so the record shouldn’t be locked due to that. Before receiving that screenshot, I asked, did you see an error that another user (integration or otherwise) was trying to gain exclusive access to the record? Only one person (or integration user) is able to update a record at a time. Looking back to the first time I encountered this issue, it was odd, but as I was scrolling through the record – it turned out, there were opportunity products on the record, even though it was still within the initial stages.

    When I inquired to the user why there were products synced with the opportunity, they informed me that this opportunity was just assigned to them from another user, and instead of closing out the Opportunity, they moved the Sales Stage back to initial. Typically, as a business process, once opportunity products are synced to the record, it is usually in the later stages.

    We can certainly discuss the positives and negatives of allowing a Salesforce user to progress back through Sales Stages in another post, however – the reason that the Salesforce Opportunity Amount field is locked is due to the Opportunity Products associated with the Opportunity. These Opportunity products are then rolled up into the Opportunity Amount field. It makes sense that, if an opportunity has products, if you want to be able to accurately forecast your opportunities, the Amount field field must become locked to coincide with the value currently on the record reflected through the products.

    Unlock Salesforce Opportunity Amount Field

    There are two options to consider how to move forward here, with of course, the guidance and approval of Sales Management:

    1) The user can Loss out the original Opportunity, and create a new one with an editable Amount field
    2) The user, with the help of an Admin, can clear out the Opportunity Products on the record.

    This decision will have to be made by the Sales Management with consideration with the other executive teams involved in the Opportunity Sales Cycle.

    When selling Software as A Service (SaaS) in an ARR (Annual Recurring Revenue) world, the Opportunity Amount field is usually a good indicator of what the Invoice Billings will be, but not necessarily what the MRR is (monthly recurring revenue), or value of the contract is worth. Sometimes it is better to have your own field value, such as MRR from the opportunity products, that can determine was the ARR of the record is, while the amount field can be left for billing/invoicing purposes.

    If you have any questions on the above,  please let me know in the comments below!

  • How to Add the Case Comment Section in Salesforce Global Search

    As a Salesforce Admin (or in other related operational roles), I strongly believe that your goal should be there to support, educate, and empower your users to solve their own problems in the future. The reason I enjoy what I do so much is that I absolutely love learning new things, and also that I enjoy sharing what I know with other people. With that said, a long while back, I had a request I’ve never experienced before:

    Email asking to show case comments.

    When this type of situation happens, where I don’t have a ready answer, I try to step back and say to myself, “What are they asking, exactly?” What I like to do initially is to get more information, like stopping by their desk, having them come over to mine, or teleconferencing in if we are working remote from each other. The user gave me a quick call prior to sending this, and I asked them to send me a quick email so I can add it to my list of to-do’s to follow up on.

    Once I worked through some high priority tasks, I was able to focus my attention to this ask.  Starting off, I went Googling to familiarize myself with the issue. In our brief conversation, they explained about seeing Case Comments in the Global Search section. The first link led me to a Salesforce Ideas post, asking for this very feature: (How To) Include Case Comments in Search.

    Including Salesforce Case Comments in the Global Search Results

    As it turns out, this very feature was delivered in a Salesforce Release, with the comments appearing around some 7 to 10 years ago. I did another quick search, and found some release notes around the same time describing this functionality. Back in the Spring ’12 release, Salesforce allowed the ability to provide a smarter global search feature. Reading more about this release, this ‘smarter global search’ allowed users to broaden their global search results by selecting the “Search All” link from the sidebar:

    Salesforce Global Smarter Search Feature
    Clicking the “Search All” link will open up all searchable object types

    After clicking that link and expanding the results, you can see what other objects have results for your query, and can be included in the search. Even better, you can even ‘pin’ the other object’s search field to the available globally searched records, if this is a search result a user will need access to time and time again. Start by hovering over the link, and clicking the ‘pin’ button:

    Salesforce Global Search Pinned Search Results

    Now it is pinned to the top of your search results! You also have the ability to Unpin if you do not want those results to be populated in the global search. Just click the pin next to the object you’d like to unpin, and select unpin:

    Armed with this knowledge, I reached back out to the user and asked to set up a quick 10 minute meeting. We did a screenshare, and I asked the user to show me what they meant by their request. They explained that when performing a search for a Case, they’d like to see the Case Comments in the results. They were under the impression that might not have the correct Org sharing rights to be able to view them. This could’ve been a different issue, but thanks to being prepared with the help of the archived Salesforce Ideas, Release Notes, and Google – I was able to walk the user through how to solve their question and find the case comments. After that, I was also able to show them that they have the ability to pin that object record search type for future reference, making their life easier! It was a great learning experience for me as well – If I ever get the same question, I have the answer ready to share!

    Note: This Pinning function of Global Search does not update for all users of your Org. Each user can customize their Global Search results by pinning whatever Object Record they need access to.

    Let me know your thoughts in the comments below!

     

  • What is an Automated Process User Doing When They Refresh a Sandbox in Salesforce

    Why did an Automated Process User refresh my partial Sandbox in Salesforce? I was unsure who this person or process was, and what it was trying to accomplish. It refreshed a Partial Sandbox that had some updates made, prior to testing and uploading as a change set. What is the Automated Process user, and what invoked the process?

    Sandbox Refresh History Automated Process User
    Here is the Sandbox History of the Automated Process User refreshing a Sandbox

    When selecting this user, even as a System Admin, the screen will return with an insufficient privileges error:

    Salesforce Error Code - Insufficient Priviliges

    Wait, what? This is interesting. Time to figure out if anyone else is experiencing this issue as well?

    Upon further investigation, it appears that this is a known Salesforce issue, that appears to only be affecting Partial Sandboxes:

    Screenshot of Known Issue in Review - Automated user Process

    If this issue affects you as well, please be sure to visit this link, click login at the top right, and check the box that “this issue affects me”! Since there are no workarounds, I’m certain that Salesforce is on it to solve the issue. Here is the link to visit the Salesforce Community’s Known Issues detail link regarding the above issue that was affecting my Org.

    To be clear, an Automated Process User is the bug. Thankfully, another Admin actually requested the refresh of the Partial Sandbox, so no harm was done to the data and affect any of the changes that were involved!