ssossossosso

Forums

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

This topic contains 6 replies, has 3 voices, and was last updated by Yevhen Shyshkin Yevhen Shyshkin 3 years, 6 months ago.

  • Creator
    Topic
  • #3938

    Hi, I’ve a littre problem. I want add to my DB an object Invoice.

    And my Entity Invoice, I use account_id (reference to Oro Account Bundle) :

    My problem is when I want add to my DB, I’ve an error.
    I can’t add my new object.

    If you are an idea, thank you.

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

    Important:

    I have a Bundle Invoice and a Bundle Local where I make all my works. I want send into my DB my new Object Invoice (in the Local Bundle).

    #3952
    Dima Soroka
    Dima Soroka
    Oro Core

    Can you please post the error message and Invoice entity definition?

    #3974

    Hi, my Invoice entity :

    The error message is:

    That’s all.

    #3979
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, ruizalexandre.

    1) First you have to set Doctrine ORM annotations for entity and fields – @ORM/Table and @ORM/Entity for class, and @ORM\Id, @ORM\Column etc. for fields (see https://github.com/orocrm/crm/blob/master/src/OroCRM/Bundle/SalesBundle/Entity/Lead.php).

    2) Then you can try to update your DB. To test that execute command `php app/console doctrine:schema:update –dump-sql` – it should show you SQL that creates DB table, and if it’s ok – `php app/console doctrine:schema:update –force` to execute SQL. You have to remember that this is ok only for debug – in any case you’ll need to add migration to create this entity.

    3) Ensure that your DB really contains table for your entity. You can either use UI DB manager, or do it from CLI.

    Try to do that – if you’ll still have an error – please, put it here.

    In general to generate DB entities I’d recommend to use command `php app/console generate:doctrine:entity` – it will add all required fields and annotations automatically.

    #3989

    Hi, I’ve made updates into my code. But I’ve the same error message.

    An idea?

    #3990
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Could you, please, do the same in dev mode and put here full error text with backtrace?
    Also you can found your errors in /app/logs/dev.log or /app/logs/prod.log.

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

You must be logged in to reply to this topic.