OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions Is possible to define dynamic choices in transition form?

This topic contains 2 replies, has 2 voices, and was last updated by  lapino 8 years ago.

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

  • Creator
    Topic
  • #28801

    lapino
    Participant

    Hi,

    i’m trying to set a dynamic list of choices in workflow transition form.

    I have an entity for example FunnelCloseReason who is a list (name, label) of possible reasons.
    I want to set that list in choices list of workflow/transitions.yml file :

    @funnel_close_reason.provider is defined in services.yml

    But I have an error :
    Uncaught PHP Exception Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: “The option “choices” with value “@funnel_close_reason.provider->getChoices” is expected to be of type “null” or “array” or “\Traversable”, but is of type “string”.”

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #28802

    Yevhen Shyshkin
    Participant

    Hello.

    Right now workflow definition does not support expressions passed directly from DI container. Instead you can define custom form type (child of a choice), pass there your provider and use it to get list of your choices.

    I’ll create an improvement to add such functionality to workflows.

    #28803

    lapino
    Participant

    Thank you Yevhen,
    I will try this, I suppose I can be inspired by examples in transitions like
    – form_type: orocrm_account_select or
    – form_type: orocrm_contact_select

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

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

Back to top