In my test project I’ve created a simple custom content type, having a Title and a number-typed field called Numeric, a list definition and a list instance including sample data and bound the custom actions to the content type.
The deployed list called Test List Instance looks like this:
Unfortunately, in this case you cannot use RegistrationType nor RegistrationId to specify the items your custom action is bound to.
In this sample I’ve created two actions, one to query the field values of the current item, and another one to reset the Numeric field value to zero for the current item.
First, let’s see the custom action definition of the “getter” method.
Selecting the menu item in the ECB and the results shown below.
The custom action definition and the “setter” method is very similar to the former one.
After a successful update, we have to refresh the page content to show the change. I achieved that simple by reloading the entire page. Some kind of AJAX-refresh would be definitely better here, but I have not yet found the right way to force that.
Selecting the setter menu item in the ECB and the results shown below. Notice the zero value of the Numeric field for the updated item.
You can download the sample project from this location.