Showing posts with label Page Layout. Show all posts
Showing posts with label Page Layout. Show all posts

Thursday, 2 June 2022

Using the Button, send the Record Id to the Flow

Scenario :
While working on one of the requirements for a health sector project for a client based out of Melbourne, Australia there was a requirement to avail current record id in a flow by clicking a button for further actions.

Approach : 
The client wants a custom button on the Contact record page to launch the flow and avail the record id in a flow.

By passing the record id in a flow URL we can get the record id in a flow. Let's see with the example. 

Follow the below steps to create a flow.

Screen Flow :

Step 1:-  Define flow properties.
  • Click Setup.
  • In the Quick Find box, type Flows.
  • Select Flows then click on the New Flow.
  • Select the Screen Flow option and click on Next and configure the flow as follows:
    • How do you want to start building: Freeform
Step 2:- Flow variable
Define recordId Text variable to store Record Id.
  • Under Toolbox, select Manager and click on New Resource.
  • Input the following information,
    • Resource Type - Variable
    • API Name - recordId
    • Data Type - Text
    • Allow multiple values (collection) - Uncheck 
    • Available for Input - Check
  • Click Done.
recordId variable

Step 3:- Create Screen Element
We will create a screen element to display Record Id in this step.
  • Under Toolbox, select Elements. Drag and drop Screen onto the canvas.
  • Fill following Information on Screen Properties.
    • Enter Label the API Name will auto-populate.
    • under Components, select Display Text, Drag, and drop Display Text onto the screen. fill the following details.
      • API Name - Show_recordId
      • Insert a resource - {!recordId}
  • Click Done.
  • Connect start element to screen element.
Screen element

Our Flow is complete, Save and Activate the Flow. below is a diagram of the Flow.

Flow Diagram

Flow diagram

Now, Our Flow looks good. Let's create a custom button on the contact object and add a button on the contact page layout.

Custom Button

Follow the below steps to create a button on the contact object.

Step 1: 
  • Go to Setup > Object Manager
  • Select a Contact Object
Step 2:
  • Go to Buttons, Links and Actions
  • Click on New Button or Link 
Step 3:
Fill in the below details.
  • Label - Run Flow
  • Name - Run_Flow
  • Display Type - Detail Page Button
  • Behavior - Display in new window
  • Content Source - URL
  • Fill the below URL in the text area
/flow/Get_RecordId_In_Flow_Example?recordId={!Contact.Id}&retURL={!Contact.Id}

Click on the Save button.
Custom button

Add the custom button to the page layout

Below are the steps to add the custom button to the contact page layout.
  • Go to Page Layout. Select the edit option.
  • Select Mobile and Lightning Experience Actions from the panel.
  • Drag and drop Run Flow custom button to the Mobile and Lightning Experience Actions section.
  • Click Save.

Contact page layout
Output


Click here to see the Trailhead badge on Distribute the Flow with a Custom Button for more information.

If you have any questions you can reach out our Salesforce Consulting team here.

Thursday, 21 October 2021

[Resolved:] Salesforce Clone does not copy all the field values

SCENARIO

While working on one of the requirements for a packaging solutions customer based out Atlanta, Georgia there was a requirement to use salesforce standard clone feature and have some sort of customization on cloned records.


Salesforce provides standard feature to clone the records. We have implemented our customization when record is cloned and have a specific field value.


After successful implementation on UAT, we started getting issues from the users regarding custom functionality is not working for cloned records. However, we were not able to replicate the same issue at our end.


RESOLUTION

After further investigation, we were able to figure out that it was occurring only for specific users. So, we have verified the user access on the object and field. Everything in terms of permission and customization was looking good.


Again deep diving in our analysis, we've found out that only users having profile with specific page layout were facing this issue. The values of fields which are not added to page layout are not copied over to newly created clone records.


After adding those fields to the page layout, the functionality worked as expected.


CONCLUSION

In Salesforce when trying to clone records, All fields must be added to the page layout to ensure values of all fields are copied over. Click Link for the reference.


If you have any questions you can reach out our Salesforce Consulting team here.

Thursday, 25 February 2021

[Resolved]: Add Tooltip over a field section using visual force page in Object Page Layout.

Introduction/SCenario

There was a need of implementing tooltip on mouse hover for field section label on the object page layout for one of the our client - consulting firm based out of Atlanta, GA, USA.

We, all are familiar with showing tooltip on page layout by dragging & dropping the Lightning Component for a specific object field on the page layout, but displaying a tooltip on the Field Section label on the record/object page layout is quite challenging. So, in this blog, I will go through in detail how Tooltip can be displayed on the mouse hover for Field Section label on the object page layout.

APPROACH
To display the tooltip on the field section label, we need to utilize custom Visual Force page in the page layout. In that page, we can have customized HTML & CSS to show tooltip on the mouse hover.
PROCESS
I've developed a custom solution that involves creating a custom Visual Force Page called ToolTip. This Page contains the mechanism to display the Tooltip of  Account Name. The page needs to be customized using HTML and CSS to show the tooltip of an Account name on a Field Section Label.
ToolTip.vfp
After creating the visual force page, we need to drag & drop the page to the specific record page layout. As, I need to show tooltip of Account Name, I've used it on the account page layout.
OUTPUT
If you have any questions you can reach out our Salesforce Consulting team here.