Defining Object Actions

Liferay 7.4 U60+/GA60+

Object actions define operations that you can run manually or automatically for object entry events.

To add an action,

  1. Open the Global Menu ( Global Menu ), go to the Control Panel tab, and click Objects.

  2. Begin editing an object definition.

    note

    For Liferay 7.4 U22+/GA22+, you can add actions to system objects.

  3. Go to the Actions tab and click Add ( Add Button ).

  4. In the Basic Info tab, enter a Name and Description for the action.

    Enter an action name and description in the Basic Info tab.

  5. Go to the Action Builder tab to define the custom trigger, conditions, and action.

    Go to the Action Builder tab to define a custom trigger, conditions, and action.

  6. Specify a trigger event to determine when the action is performed.

    TriggerDescription
    On After AddWhen an entry is added
    On After Attachment DownloadWhen an entry attachment is downloaded
    On After DeleteWhen an entry is deleted
    On After UpdateWhen an entry is updated
    StandaloneTriggered manually

    All triggers besides standalone are automatic. Standalone triggers are for running any type of action manually. See Using Manual Actions for more information.

    Determine when the action is performed.

  7. (Optional) Enable a condition for automatic triggers. Click Code ( Code ) to view available expressions.

    On Liferay 7.4 U33+/GA33+, Liferay validates the condition’s syntax when you click Done. If the expression is invalid, Liferay displays an error message. See Expression Builder Validations Reference for more information on available fields, operators, and functions.

    Use expressions to set additional conditions for the trigger.

  8. Select the type of action to perform and fill out all additional fields.

    TypeDescription
    NotificationSend email or user notifications using a predefined template.
    Add an Object EntryCreate entries in an active object.
    Update an Object EntryUpdate fields in the current object entry.
    WebhookDeliver a payload to a URL.
    Groovy ScriptExecute custom Groovy scripts.
    Important
    • Groovy script actions are only available for Liferay PaaS and Liferay DXP Self-Hosted.
    • As of DXP 2024.Q3, scripting is disabled by default. You can enable it in System Settings → Script Management (under the Security category).

    See Understanding Action Types for more information.

  9. Click Save.

Once created, the action is active and triggered according to your configuration.

You can deactivate an action from its Basic Info tab. Toggle the Active switch and click Save.

Toggle the Active switch to deactivate the action.

Sending Translated Email Notifications to Guest Users

Liferay DXP 2024.Q3+/Portal 7.4 GA125+

By default, Liferay sends email notification templates’ backing object notification actions to guest users in the instance’s language. While configuring the object action, you can enable Send email notifications in the guest user’s preferred language to detect the user’s preferred language and send email notifications in that language instead. When enabled, the language used in the guest user’s object entry submission becomes the language used in email notification templates. If no translation is available, the instance language is used.

Send email notifications to guest users in their preferred language.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy