OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions FieldType entity account not display in form entityType ( using migration )

This topic contains 2 replies, has 1 voice, and was last updated by  adriwan_kenoby 7 years, 11 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
  • #25193

    adriwan_kenoby
    Participant

    Hi everybody,

    I have a problem with form.

    I added a relation between Account (OroCRMAccountBundle:Account) and a custom entity using migration ( because i wanted to have a bidirectionnal relationship )

    I want to added a field in my custom entityType to choose an account relied to my entity.

    I am aware that the probleme is I added the relation between custom entity and account using migration,

    then i havent the attribute $account in my class and then it cannot be shown in form. I assume that it was generated automaticaly. How can i manage it ?

    May i use common doctrine relation ? But then the relationship will no longer bidirectionnal …

    Moreover, I have notice some weird thing that i don’t understand in form :

    – in FormBuilderInterface::add() when i use entity type , i have to define data_class but if i forgot the first ‘\’, i have an error when i want to edit my entity. ( resolver wait for an object but he found boolean ?)

    – with OptionsResolverInterface::setDefault(), if i put the first ‘\’ to define data_class then i haven’t error but the ownership field diseapper. I don’t undestand why this make a difference…

    Here is my code but you can found it on gitlab :

    For the moment I think I will abandonned migration solution to a common unidirectionnal relationship, but if you have a solution, i am interesting.

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

    adriwan_kenoby
    Participant

    I was wrong, still the same problem using common unidirectionnal relation in my entity

    #25195

    adriwan_kenoby
    Participant

    Sorry, i just forget to add the field in my view.

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

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top