+44 (203) 695-03-80

Customization: Dynamic Forms

There is an ability to define a form behavior in EspoCRM.

Example: Need to show nextStep field on Opportunity detail view only if stage is ‘Closed Won’.

Create a file custom/Espo/Custom/Resources/metadata/clientDefs/Opportunity.json

{
  'formDependency': {
    'stage': {
      'map': {
        'Closed Won' : [
          {
            'action': 'show',
            'fields': ['nextStep']
          }
        ]
      }, 
      'default': [
         {
             'action': 'hide', 
             'fields': ['nextStep'] 
         }
       ]
    }
  }
}

That means that nextStep field will be hidden by default and shown if stage equals ‘Closed Won’.

The list of available actions: ‘show’, ‘hide’, ‘setRequired’, ‘setNotRequired’.

2 comments on “Customization: Dynamic Forms
  1. Anna says:

    This type of thing really needs to be configurable by Admin users.

Leave a Reply

Your email address will not be published. Required fields are marked *

*