OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions Add auditable option to extend entity?

This topic contains 2 replies, has 2 voices, and was last updated by  a.azadi 4 years, 7 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
  • #40374

    a.azadi
    Participant

    Hi everyone. I had a problem with making an entity field auditable. I have a field added to my entity using Migration. Now I want to edit its options and make the field auditable. I searched a little and I found this link: Github

    I had this PHP code and function before:

    After seeing the link I added this option:

    And now finally my code looks like this:

    I added the option but the problem is that the code is not working and I tried to change this field to true and false but it’s not working and it’s not saving any change history.
    It there any command that I should run or is there anything that I’m missing here?
    I will appreciate your help. I want to make the field auditable to see what changes by whom has been made.

    Thanks,
    Aryana.

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

    Andrey Yatsenko
    Moderator

    Make sure you have run oro:platform:update command after adding the migration.
    Also, notice that migration changes will not be applied when the migration was executed before, so you have to restore the database state to apply it again or write a new migration that will change the entity config.

    #40408

    a.azadi
    Participant

    Thank you for your response.
    So to make any changes I need to delete migration then add it again with new configs?
    Because I have some data in that field and I can’t restore database then add migration again with new configs. All the data will be lost
    Also my Oro version is 1.8.
    Isn’t there any other way to make this field auditable without having to restore database state and add the migration again?

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

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

Back to top