OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions extend existing entity with multi-selected field

This topic contains 8 replies, has 2 voices, and was last updated by  fred33 7 years, 4 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
  • #29153

    fred33
    Participant

    Hi,

    All is in the title…I just want to extend an existing entity with a selected field..or is there a way to update the source code when creating this field with the GUI

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #29154

    Mike Kudelya
    Participant

    Hi

    You can do this via migration or just add Multi-Select field from this section ‘System -> Entities -> Entity Management’. Fifth parameter of addEnumField function is isMultiple.

    #29155

    fred33
    Participant

    I created my multiselect field via gui but this is not the right way to do it because I need it for one of my bundles. How to declare a multiselect field in an entity.php???

    #29156

    Mike Kudelya
    Participant

    Hi

    Your field have already declared in entity file. For example Opportunity entity contains ‘status’ field, but you can’t find it in vendor/oro/crm/src/OroCRM/Bundle/SalesBundle/Entity/Opportunity.php, because Opportunity.php extends from ExtendOpportunity and ExtendOpportunity replaces with app/cache/[cache dir]/oro_entities/Extend/Entity/EX_OroCRMSalesBundle_Opportunity.php where you can find status property. If you want to access to your field or override function try to extend original entity (if it exists) or access to it directly from your entity.
    What is your final goal ? What do you want to do ?

    #29157

    fred33
    Participant

    I want to extend the entity calendar_event with two multi-select fields to be able to reuse them in a javascript. I have done it through the GUI but I can not access it when I write my code. I know how to extend entity but i don’t know how to declare multi-selected field

    #29158

    Mike Kudelya
    Participant

    You can access to field usual approach $calendarEvent->getYourMultiSelectName()

    #29159

    fred33
    Participant

    Even if I do not see it in the source code ?

    #29160

    Mike Kudelya
    Participant

    Yes, new extended fields won’t appear directly in the CalendarEvent. Try to find your property and getters/setters in app/cache/[dev or prod]/oro_entities/Extend/Entity/EX_OroCalendarBundle_CalendarEvent.php

    #29161

    fred33
    Participant

    Ok i find it

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

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

Back to top