OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions Dynamic enum with extension

This topic contains 4 replies, has 3 voices, and was last updated by  dawid.zaroda 1 year, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
  • #37529

    Hello Dawid,

    When you create new enum type you are in fact creating new entity and a relation to it.

    In your case I can suggest 3 possible solutions:

    1) create new enum type and use it. You can add some values during the migration and later on through UI/migrations.
    2) create many-to-one relation from Account to your entity instead of enum
    3) if for some reason you want to create enum and sync it’s values with your entity you can do this using postUpdate/postPersist events on Account add/update your enum field values.

    Please tell me if you have any additional questions.


    • This reply was modified 1 year, 11 months ago by mlukaszewicz mlukaszewicz.


    Hello Martin,

    thank you for response. I chose option number 2 and added many-to-one relation. But problem is, that I can not add any additional conditions, like “don’t pick deleted rows”. My code:

    Can you help me with that, please?

    Best regards,

    Yevhen Shyshkin
    Yevhen Shyshkin

    Hello, Dawid.

    If I understood you correctly you want to restrict list of entities you’d like to see at you entity dropdown. The easiest solution for that is to create custom form type (probably autocomplete) and add your restrictions there. Then you can set your form type to entity field configuration, so application with use it instead of the default form type.

    Here is example of how it can be done:

    Pretty good example of such functionality is available here.



    Hello Yevhen,
    thanks for your help – it works.


Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No