Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DataObject + getCMSActions - still not working


Go to End


2 Posts   1424 Views

Avatar
hello_world

Community Member, 19 Posts

8 March 2016 at 1:21am

Hi,
I have a code

class Invoice exnteds DataObject {
...
public function getCMSActions() {

$fields = parent::getCMSActions();
$button = new FormAction('sendbutton', 'Send invoice');
$fields->push($sendbutton);
return $fields;
}
}

But it does not working.
SendButton not added.

How can I create new action - directly in dataobject ?

Best

Avatar
camfindlay

Forum Moderator, 267 Posts

8 March 2016 at 11:20am

Hi there, you might want to check the spelling of some of your variable in your example.

I also came across this example (sorry there's no annotation) if you can pick your way through it and reverse engineer for your needs it might help: http://www.sspaste.com/paste/show/518e3dc335c85