OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform Form association

This topic contains 4 replies, has 2 voices, and was last updated by  William Radi 5 years, 10 months ago.

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

  • Creator
    Topic
  • #37173

    William Radi
    Participant

    Hello there!

    More questions… :)

    By means of a migration, I created an association with 2 entities: Account and Coverage(Abrangência).
    Oro created automatically to me the Coverage field in the Account form, at the additional section:
    Coverage_field

    But this field shoudn’t appear in this form… So, how is the right way to take it out of the form?
    I don’t want to undo the association, just don’t want to show it in html

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

    ibratsilo
    Moderator

    Hi, William,

    It should be possible to disable displaying it via UI configuration.
    Go to System -> Entities -> Entity Management -> Accout Entity (view)
    Find appropriate field in the list (Coverage field) and click Edit
    You should see such window: https://prnt.sc/jnie4v

    So you need to set Show On Form to No

    #37175

    William Radi
    Participant

    Thanks, Ibratsilo! :D

    Works! o/

    Before to close this topic, is there a way to do it by the code side?
    If there is, could you give me an exemple? :D

    Like, if it’s done by migration, how should it looks like?

    Thanks, man!

    #37176

    ibratsilo
    Moderator

    I am glad to help!

    Regarding migrations. You should pass needed option to your migration (initial one) array $options argument.
    It should be like this – [‘form’ => [‘is_enabled’ => false]]

    Second possible solution if you want to modify this value on other migration is to use:

    Oro\Bundle\EntityConfigBundle\Migration\UpdateEntityConfigFieldValueQuery

    It gives possibility to change config field value of certain entity.

    So your code may be like this:

    #37177

    William Radi
    Participant

    Thanks again, Ibratsilo!

    Everything working! :D

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

The forum ‘OroPlatform’ is closed to new topics and replies.

Back to top