You need to sign in to do that
Don't have an account?
Masie Maseli
Custom Javascript button invoke standard functionality
Hi all
I have custom list view button that changes a record's ownership to the current user. I want to find out if it is possible to have the button open the standard change owner screen?
I have custom list view button that changes a record's ownership to the current user. I want to find out if it is possible to have the button open the standard change owner screen?
The relative url to standard change owner screen is Let me know if you need any more illustration.
--Akram
I definitely need more illustration as I have been trying and I am just not getting it right. I have pasted my current javascript below.
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Account)};
var updateRecords = [];
if (records[0] == null) {
alert("Please select at least one record to update.");
} else {
for (var a=0; a<records.length; a++) {
var update_Account = new sforce.SObject("Account");
update_Account.Id = records[a];
update_Account.OwnerId = "{!$User.Id}";
updateRecords.push(update_Account);
}
result = sforce.connection.update(updateRecords);
parent.location.href = url; //refresh the page
}
Thanks for the code. As I can see you are changing owner of multiple records at a time.
But standard change owner screen is for one record at a time. It is very much possible to open the standard change owner screen, but it will work only for one record.
--Akram
http://www.salesforce.com/docs/developer/pages/Content/pages_quick_start_massupdate.htm
--Akram