OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Creating Custom Activity Entity

This topic contains 6 replies, has 2 voices, and was last updated by  archy_bold 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
  • #25175

    archy_bold
    Participant

    Hi there.

    I’m trying to create a custom activity entity in code but I’m having some trouble. I’ve followed the instructions on this page and created my entity, which extends an ExtendEntity, which in turn implements the ActivityInterface. I’ve also set up a migration to create the table.

    I then run the following commands to run the migrations and update the schema/cache:

    But looking in the oro_entity_config table, I can’t see my new entity. I’ve added several custom entities and it has always worked doing things this way.

    I then tried to add the associations to my own custom entities with ActivityExtension migration tool regardless. Obviously it failed to run and had the following error:

    Which I guess is because the entity isn’t present in the database. Am I missing something here? I’m a little worried even if I get this working, that it might have trouble ensuring the migrations run at the correct time when deploying the bundle.

    Thanks for your help.

    Simon

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #25176

    Vova Soroka
    Participant

    Hi @archy_bold,

    please try to run

    this will run migrations and renew all caches.

    #25177

    archy_bold
    Participant

    Thanks, but I still get the same error. And the entity doesn’t show up in the database either.

    #25178

    archy_bold
    Participant

    Is the error because I’ve manually written my migrations? Should I be letting oro:platform:update handle the table creation?

    #25179

    archy_bold
    Participant

    Here’s the code, if that will help:

    Entity/UserActivity.php

    Model/ExtendUserActivity.php

    Migration 1

    Migration 2

    #25180

    archy_bold
    Participant

    I’ve run the following command to see if my new entity is being recognised and I don’t see it in the list at all. Despite it containing all my other custom entities. There must be something wrong with the entity itself.

    #25181

    archy_bold
    Participant

    Ok, I’m an idiot. My entity didn’t have the Entity annotation…

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

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

Back to top