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

Custom Button - giving error

I am getting following error
"Unable to find form for this button" for a detail page button. Any idea what may be wrong.
What are the settings on the custom button?  Execute Javascript?  Run an Scontrol?  Need more detail here.
// Include and initialize the AJAX toolkit library
// Get a list of Contest Point Transaction IDs for checked valuesvar
idList = {!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
Well you said it was a detail page button, but you're using GETRECORDIDS.  That only works in List Buttons.
realized this after posting . Now it is working.
is using Web Service a better solution in above scenerio or call the class from trigger ?
Does SFDC edition (prof or enterprise) pose any problem ?
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.