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
VinodKRVinodKR 

How to Disable or Remove Transfer closed opportunities check box in Ownership Edit page(Account)

Hi All,

 

I want to Disable or Remove Transfer closed opportunities check box in Ownership Edit page(Account) for a profile. 

 

Thanks

  VKR

Vijay_NaikVijay_Naik

Hi VKR,

 

Try this, worked for me.

 

Create a home page component of type HTML, with following code

(don't forget to check 'show HTML' checkbox, and make sure component position is 'Narrow (Left) Column')

 

 

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ap1.salesforce.com/soap/ajax/25.0/connection.js"></script>
<script type="text/javascript" src="https://ap1.salesforce.com/soap/ajax/25.0/apex.js"></script>
<script>
$j = jQuery.noConflict();
$j(document).ready(function() {
var objectPefix = window.location.href.substring( window.location.href.indexOf('.com/') + 5, window.location.href.indexOf('.com/') + 8 );
var changeOwnerPrefix = window.location.href.substring( window.location.href.indexOf('.com/') + 20, window.location.href.indexOf('.com/') + 22 );
if(objectPefix=='001' && changeOwnerPrefix=='/a'){
var sid = getCookie('sid');
var server = "https://" + window.location.host + "/services/Soap/u/27.0";
sforce.connection.init(sid, server);
var currentUser = sforce.connection.getUserInfo();
var profileId = currentUser.profileId;
if(profileId.substring(0,15)=='YOURPROFILEID'){
document.getElementById("transClosedOpps").disabled=true;
var labels = document.getElementsByTagName('label');
for (var i = 0; i < labels.length; i++) {
if(labels[i].htmlFor=='transClosedOpps'){
labels[i].innerHTML='Transfer closed opportunities (has been disabled, please contact your system admin for assistance)';
}
}
}
}
});
</script>

 

 

Just replace 'YOURPROFILEID' with the id of the profile (15 digits) for which you need to disable the checkbox.

 

Then add the home page component to the home page layout associated with above profile.

 

Regards,

Vijay_Naik

VinodKRVinodKR

Hi Vijay,

 

Many Thanks for your post, Similar approach worked for me earlier.