Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
- {!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
- var newRecords = [];
- var ids= {!GETRECORDIDS($ObjectType.CloudConversion__Message__c)};
- //Confirming users action
- var r = confirm('Take ownership of these messages?');
- if(r == true) {
- if(ids.length < 1 ) {
- alert('Please select at least one message.');
- } else {
- for (var n=0; n<ids.length; n++){
- var sv = new sforce.SObject('CloudConversion__Message__c');
- sv.CloudConversion__Status__c = 'Working';
- sv.OwnerId = '{!User.Id}';
- sv.id = ids[n];
- newRecords.push(sv);
- }
- result = sforce.connection.update(newRecords);
- }
- }
- window.location.reload();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement