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

Forums OroCRM OroCRM – How do I? Questions Show a custom field in View page

This topic contains 1 reply, has 2 voices, and was last updated by  sparlea 6 months, 2 weeks ago.

  • Creator
  • #58262



    I followed the documentation to create a new field using Migrations. Then I followed this solution to create a form extension to be able to show the field in the update form.

    I can see the field in the update form. I can save the value to the table.

    Now how do I show this field in the view form? The renderDynamicFields is showing the field. But it shows all the custom fields in one column, one below the other. I want to have some control in displaying the fields in a two column layout. When I try doing this:

    I am getting the following error:

    I tried using the macro renderDynamicField(account, “test_field2”), but it gave me an error saying that the second parameter should be FieldConfigModel type.

    I have actually hit a wall. Can somebody please help me?


Viewing 1 replies (of 1 total)
  • Author
  • #58263


    Hello hmadhur,

    I have a solution for your problem, you can use the renderDynamicField macro but you will need to send a FieldConfigModel, for the field that you want to render, from backend.

    Here’s a quick example, i have a dynamic field named test_field on my Product
    This is a raw example, in my controller i get a FieldConfigModel object for my dynamic field that i will pass it to my view:

    And in my twig template i render the field using:
    entityConfig.renderDynamicField(entity, field)

    Hope this helps.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.