function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Del SantosDel Santos 

Can i make the Sales Path as read-only to users?

Hi!

Anybody have an idea on how can I make the Sales Path on lead page read-only?
I do not want users to click on this path to mark it as complete..

I want them to use the Lead status field from the detail page to change the lead status..Once saved, the status will just reflects in the sales path section.

Thanks!
karthikeyan perumalkarthikeyan perumal
Hello, 

As per my understanding in this knowledge artical  sales path  has been assicoated with Record types. if user dont want to modify your path setting to restrict user to modifiy or create record type for that object user permission set. hoe this will work. 

https://help.salesforce.com/articleView?id=000212199&type=1

Hope this will work. 

Thanks
karthik
 
Justin Feldman 7Justin Feldman 7
For anyone looking to add a read-only path to a community page, I came up with a bit of a hack which achieves the read-only functionality without Apex code or a custom lightning component. 

1. Add this Custom CSS to your Community:
.forceCommunityPathAssistant .tabs__nav .tabHeader,
.forceCommunityPathAssistant .stepAction {pointer-events: none !important;}

2. Set the field-level security for the field that the path uses to be read-only for all relevant Community User Profiles, OR, create a validation rule which prevents editing this field.

NB: It is ESSENTIAL that you do step 2. CSS can be edited by any user client-side. Therefore you need to provide some server-side data protection (the field-level security or validation rule.)
Marc LesterMarc Lester
Not sure if you are still looking for a solution to this question, but this functionality is currently available.  It has to be selected on each Lightning Record Page that includes a Path, but when editing the Lightning Record Page click on the Path component, then on the right side of the screen there is a checkbox labeled "Hide path update button".  Checking this box will remove the "Mark Stage as Complete" button and make the Path a simple visual representation of the field values.
User-added image
Rajiv Penagonda 12Rajiv Penagonda 12
This thread is old, but for anyone (like me) who come looking for a solution. Here is what worked for me:

Mark the attribute "hideUpdateButton" as false on lightning:path, implement a function for the "onselect" as follows:
myAction : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");
        
        toastEvent.setParams({
            "mode" : "sticky",
            "type" : "error",
            "title": "Invalid Operation",
            "message": "You do not have permission to change the Project Stage."
        });
        
        toastEvent.fire();
		$A.get('e.force:refreshView').fire();
	}

There is no standard way for making lightning:path as read-only, instead once the user selects a stage, take corrective action by showing an error message and refresh the view so that the path goes back to default (or the one selected). Hope this helps.
Marc LesterMarc Lester
Rajiv, did you see my post from last year on this thread?  There now is a way to do this without developing code, per my post.
Rasan AminthaRasan Amintha
Hi Marc I did this but it didnt work in communities though. Although it worked inside Salesforce. Do you have a workaround for communities
Harsit Agrawal 7Harsit Agrawal 7
It's never too late. We can add validation for the same. The validation goes as follows:
 
IF(
	AND
	(
	ISCHANGED(sales_Status__c), 
		OR(
			CONTAINS($Profile.Id, '<PROFILE ID 1>'),
			CONTAINS($Profile.Id, '<PROFILE ID 2>'),
                        CONTAINS($Profile.Id, '<PROFILE ID 3>')
		)
	),
	true,
	false
)


I have done it for 3 profiles, you can keep on going with more profiles as per the requirement. sales_Status__c is my field which is controlled by the path.

Give a thumbs up if it works for you

Juan BlancoJuan Blanco
I believe the original question was geared towards the Sales Cloud, i.e. not Communities/Experience Cloud. As I totally understand that pain because we often have a similar request: even with the path update button hidden, the user can still click on a new status and the visual change in the Path makes it seem as if the status is changed! But of course, it isn't... super confusing.

No way to do this without code, and here is a sample that apparently achieves this: https://www.jitendrazaa.com/blog/salesforce/salesforce-path-read-only-lightning-component/

Other than that, vote this: https://trailblazer.salesforce.com/ideaView?id=0874V0000015MT8QAM
Deepak Hanumantha AndeliDeepak Hanumantha Andeli
Hi

I built on @Justin Feldman's approach for our community and documented the solution that works for us.
Read only Sales/Stage Path on the Salesforce community (https://medium.com/me/stats/post/67f86c4d1432)