ParentType in Conditional Options of Enum-Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ElJay
    Junior Member
    • Feb 2026
    • 4

    #1

    ParentType in Conditional Options of Enum-Fields

    Hi there.
    I'm using the cloud version of Espo.

    In my setup I have the entity "Calls" which can be created with the entity Accounts or Leads as parents.
    While creating, I want to have different options in an enum-field based on if the current chosen parent is an account or a lead.

    I've tried to accomplish that by using "conditional options" of the enum-field but it doesn't work.
    If I choose the field "parent", I can't define the type. Only if I choose a specific account/lead but it doesn't matter what account/lead only that an account/lead is currently selected.
    If I go for e.g. "parent not empty" it'll apply for lead and account.
    Click image for larger version

Name:	image.png
Views:	0
Size:	31.8 KB
ID:	124934


    In workflows for example there this parent-option with which I can filter what I need.
    Click image for larger version

Name:	image.png
Views:	0
Size:	5.6 KB
ID:	124933

    Does anyone have an idea how to have different options in an enum-field based on if the current chosen parent is an account or a lead?
    Thanks in advance
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9681

    #2
    Hi,

    Currency, Dynamic logic does not support the Type Of condition for Link Parent fields.

    Comment

    • Ashif Malayil
      Senior Member
      • Dec 2023
      • 256

      #3
      HiElJay,

      Another effective approach is to use a "new field" and copy the parent type to the new field. You can set this up in three steps:
      1. Create a New Field: In Entity Manager > Calls, create a new Varchar field (e.g., parentTypeValue). Set it to "Read Only" and "Hidden" so it doesn't clutter the user interface.
      2. Add a Formula: In Entity Manager > Calls > Formula, add the following line:

        parentTypeValue = parentType;

        This maps the system-level parent entity type to a field that is accessible by the front-end conditional logic.
      3. Set Conditional Options: Go to your Enum field settings. Under "Conditional Options," you will now be able to select parentTypeValue:
        • If parentTypeValue Equals Account -> Show Account options.
        • If parentTypeValue Equals Lead -> Show Lead options.
      Note: I haven't tested this specific configuration yet, but the logic follows standard EspoCRM behavior. Give it a try!
      Last edited by Ashif Malayil; 02-25-2026, 08:58 AM.

      Comment

      • ElJay
        Junior Member
        • Feb 2026
        • 4

        #4
        Hi Ashif Malayil ,

        this sadly doesn't work because the formula will only be executed after create and before saving, not initially when the form for creating a call is loaded.

        Comment

        Working...