ssossossosso

Forums

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

Open-Source CRM software Forums OroPlatform OroPlatform – How do I? Questions New Field On Existing Entity Best Practices

This topic contains 9 replies, has 4 voices, and was last updated by Ale Cerutti Ale Cerutti 2 years, 8 months ago.

  • Creator
    Topic
  • #4566

    keganv
    Participant

    Hi there, I need to be able to put a new field called “team” on the user entity. This is easy enough via the UI, however, I’m not seeing any code or migrations being written that would allow me to push that change to a git repo for my team members to pull and update their app with.

    I tried the regular Symfony way of bundle inheritance, however that doesn’t seem to be working either. I saw that Oro has all the forms set up as services and wasn’t sure if that might be why my form type is not overwriting Oro’s?

    What is the best practice when I need these fields to be trackable/pushable to a repo.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #4567

    Vova Soroka
    Oro Core

    Hi,
    you can use migrations to add new field. An example you can find in AccountBundle

    #4569

    keganv
    Participant

    Hi Vova, I had already tried this way as well. However, this did not put the new field in the view when editing a user, or on the System/ Entities/ Entity Management/ User page. Could I be missing something?

    #4571

    keganv
    Participant

    I should add that I ran the php app/console oro:migration:load command also. The field never did show up on the view and edit pages.

    #4572

    keganv
    Participant

    I got it to work, it had to do with a core bundle, I did a fresh install and all is working properly now. Thanks!

    #4573
    Ale Cerutti
    Ale Cerutti
    Participant

    Hi,
    I pass the same problem, and my solution was to use Migration to extend an Entity. I followed this link http://www.orocrm.com/forums/topic/add-custom-field-into-orocrm-entity and all work fine.
    You can’t see the new fields in the entity that you extends, but they should see on the “Additional” form tab and, in the controller, you can access them just like a normal entity attribute.

    Hope this help! If you need a complete example, just tell me!

    Bye bye

    #4575

    keganv
    Participant

    Now my issue is that I added an “addOptionSet” in my migration. By itself that works fine. However, how can I write my migration so that the options are populated via the migration script? I don’t see any documentation or read me file help on this. I tried “choices”, which would be the natural symfony way, but that throws errors.

    #4576
    Ale Cerutti
    Ale Cerutti
    Participant

    I tried the addOptionSet code from OroCRMSalesBundle and the Migrations works fine, but i can’t see any field option neither in the form nor in the data base. I had miss something? I’m learning OroCRM too, and this help me a lot.

    Bye bye

    #4577
    Dima Soroka
    Dima Soroka
    Oro Core

    Hi guys

    We are aware of a few issues related to option sets and planning pretty big refactoring in this area in nearest future. Issues that you mentioned we’ll include in the scope. Please let us know if you find something else.

    Thanks

    #4584
    Ale Cerutti
    Ale Cerutti
    Participant

    Thanks Dima, I let you know if I find an issue. Soon, I’ll start a big project with OroCRM and by now, I have to testing and learning it.

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

You must be logged in to reply to this topic.