OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Extend contact entity programmatically

This topic contains 7 replies, has 3 voices, and was last updated by  klipach 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #24814

    Alexandr Smaga
    Participant

    Hey!

    Please take a look to Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension.
    It helps to add “extended” fields to entities from migrations.

    #24815

    luemic
    Participant

    Unfortunatelly I don’t get it to work. What I want to is the following scenario:

    * extend the oro crm contact with custom attributes, like contact classification, which is a n:1 relation from database point of view

    I tried to add a custom entity like it is described in the documentation and in the EntityExtendBundle, but if I run app/console –verbose oro:migration:load the Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendConfigMigration ends up with the exception The command terminated with an exit code: 255.

    My migration script looks as follows:

    Is the an example how to set up such a relation properly or is there some documentation about it somewhere?

    Kind regards

    Michael

    #24816

    Alexandr Smaga
    Participant

    Hey!

    Did you see this one ? There is some explanation, but unfortunately we don’t have detailed documentation for this.

    Correct migration code is following

    #24817

    Alexandr Smaga
    Participant

    Hm…

    Please don’t use code above correct is this one

    #24818

    luemic
    Participant

    Hi,

    unfortunatelly I read your last post after I implemented the code you posted previously, but I found the solution myself after digging a little bit in the ExtendExtension and it looks like the correct code :). However if I want to display the ContactClass in the datagrid, I get the follwoing error:

    An exception has been thrown during the rendering of a template (“[Semantical Error] line 0, col 297 near ‘classification,’: Error: Invalid PathExpression. Must be a StateFieldPathExpression.”)

    when using the following options in the migration script:

    instead of

    while adding the relation.

    What is the correct way to get the ContactClass displayed in the contacts grid?

    Kind regards

    Michael

    #24819

    luemic
    Participant

    Hi guys,

    now I’m stumbling with the creation of a many-to-many relation between an ExtendEntity and the contact table.
    My code looks like this

    The migration script works fine but if I want to add some data (does not matter if it’s the Technology or the Contact entity), then I got an exception with the message:

    Property Extend\Entity\Technology::$contact_technology does not exist

    How is this task done the proper way?

    Kind regards

    Michael

    #24820

    klipach
    Participant

    Is there any solution for last question? I get the same result on oro-crm 1.4.0

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

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

You will be redirected to [title]. Would you like to continue?

Yes No