Problem/Motivation
Creating a custom action works well, based on the example and on the code, but misses documentation on how to send back the result of a calculation to a variable.
Steps to reproduce
Normal install 2.0.0-beta1 released 16 March 2021 on latest version of Drupal 9.4.8
Hi,
I'm creating a paid membership service based on Business-rules. Payment is followed up manually and introduced via a content type. On payment I need to do some calculations on dates to renew the subscription. I prefer not to work with commerce because of too complex for the user for this simple task. Most of the work can be done by the out-of-the-box actions and work fine. For the moment I avoid sending back the calculated value by setting a field in the content type in my custom code, but it would be niceer to be able to do it via the variables.
The only action I see that achieves this in a way is the FetchEntityVariableAction but is way to complex for what I need to return. (or is there a better example?)
Is there a 'simple' way to do this?
I suppose I need to steps:
1 create a formfield in the getSettingsForm-function to hold the variable name
2 apply a setArgument-method on the $event-object to send it back to the event
Could you give me a hint on how to achieve this?
Kind regards,
Erwin
Comments