OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums 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 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
  • #29356

    hmadhur
    Participant

    Hi,

    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?

    Thanks.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #29357

    sparlea
    Participant

    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)

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

Back to top