Simple conditions in an Automated Action

The requirement is to print an extended description on a document if one has been entered, and if not to print the standard description. Of course this can be adapted for other purposes.

To do this we will create two new text fields:

  1. x_studio_extended_description (for the user to enter a description)
  2. x_studio_print_description to print on the document.

Enable Developer Mode, navigate to Settings / Technical / (Automation) / Automated Actions and click on “create”.

if record.x_studio_extended_description: 
    record['x_studio_print_description'] = record.x_studio_extended_description 
else: 
    record['x_studio_print_description'] = record.name

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s