ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

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

  • Creator
    Topic
  • #16573

    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
  • #16581
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    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.

    #17190

    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)

You must be logged in to reply to this topic.