Trouble loading custom element action (menu option) How do you load a custom element action using getAvailableActions inside my Element Type class?

public function getAvailableActions($source = null)
{
    $customAction = craft()-&gt;elements-&gt;getAction('Custom');

    $customAction-&gt;setParams(array(
        'label' =&gt; Craft::t('Custom'),
    ));

    $actions[] = $customAction;
}


The above renders a PHP error PHP Fatal error: Call to a member function setParams() on a non-object

PluginName_CustomElementAction is my file inside the elementactions folder, inside my plugin. Which is copied directly from https://craftcms.com/docs/plugins/element-actions 

Here's what it looks like:

namespace Craft;
class PluginName_CustomElementAction extends BaseElementAction
{
    public function getName()
    {
        return Craft::t('Custom');
    }

    public function isDestructive()
    {
        return true;
    }

    public function performAction(ElementCriteriaModel $criteria)
    {
        // Remove all the ingredients from the selected elements
        $elements = $criteria-&gt;find();

        foreach ($elements as $element)
        {
            craft()-&gt;cocktailRecipes-&gt;removeAllIngredientsFromElement($element);
        }

        // Success!
        $this-&gt;setMessage(Craft::t('Ingredients removed successfully.'));
        return true;
    }
}


What is wrong with my getAvailableActions object?
I think your issue may be that the ElementsService getAction method expects the full classname for your custom ElementAction (sans the "ElementAction" suffix), i.e.

$customAction = craft()-&gt;elements-&gt;getAction('PluginName_Custom');