Covering OroCommerce topics, B2B eCommerce trends, community updates and company announcements.

This topic contains 2 replies, has 2 voices, and was last updated by  tjurczak 4 days, 21 hours ago.

  • Creator
  • #3802


    I would like to extend customer entity to add new field “vat”. This field should be editable in backend and visible on grids. I decited to use EntityExtendBundle. I wrote migration script and new field has been appeared on backend. Great, but now I would like to use this field in businness logic in code $customer->getVat(). You warn on documentation:

    It is not recommended to rely on the existence of dynamic fields in your business logic since they can be removed by administrative users.

    What should i do? Mark dynamic field as “is system” (to prevent to delete entity) and create some mock class for intelisense in IDE (how?), or maybe i should use different method to add new fields like overriding entity objects (standard symfony).

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


    Yes, you right. You should mark that field as system, that will prevent deletion of that field from interface.

    In migration please use

    Constant is available in



    I have another problem which is related to extended fields. I want to use extended field (vat) in registration form. If I add new field in form (in this example changed class in vendor, vendor/oro/customer-portal/src/Oro/Bundle/CustomerBundle/Form/Type/FrontendCustomerUserRegistrationType.php), bellow exception will be raised durring generation form:

    Neither the property “vat” nor one of the methods “getVat()”, “vat()”, “isVat()”, “hasVat()”, “__get()” exist and have public access in class “Oro\Bundle\CustomerBundle\Entity\CustomerUser”.

    Object form model is vendor/oro/customer-portal/src/Oro/Bundle/CustomerBundle/Entity/CustomerUser.php which know anything about field vat.

    How to add new field in customer registration form? Is it possible if we use extended fields?

    Thanks for help!

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

You must be logged in to reply to this topic.