ssossossosso

Forums

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

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

  • Creator
    Topic
  • #35861

    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
  • #35906

    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)

You must be logged in to reply to this topic.