// Include and initialize the AJAX toolkit library {!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")}; // Get a list of Contest Point Transaction IDs for checked valuesvar idList = {!GETRECORDIDS($ObjectType.gii__SalesOrder__c)}; alert({!GETRECORDIDS($ObjectType.gii__SalesOrder__c)}); if (idList == null || idList.length == 0) { // Nothing selected alert('Please select one or more items.'); } else { // Pass list of IDs on to Class // result = sforce.apex.execute('MyCustomObjectClass', 'getItems', {ids : idList}); alert(" I am here"); }
following is the javascript - Execute Javascript and button at detail
It depends on what you're doing. If you're just making a single update to all the IDs then you can probably do it inline with an AJAX Toolkit call (of course, if you're doing that then you have to ask yourself if you really need to do that given the functionality in the new list views).
This button will not work in professional edition unless the PE customer has bought the API addon.
{!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")};
// Get a list of Contest Point Transaction IDs for checked valuesvar
idList = {!GETRECORDIDS($ObjectType.gii__SalesOrder__c)};
alert({!GETRECORDIDS($ObjectType.gii__SalesOrder__c)});
if (idList == null || idList.length == 0) {
// Nothing selected alert('Please select one or more items.');
} else
{ // Pass list of IDs on to Class
// result = sforce.apex.execute('MyCustomObjectClass', 'getItems', {ids : idList});
alert(" I am here");
}
This button will not work in professional edition unless the PE customer has bought the API addon.