Grid Field

Certified Associate Developer

I am querying a record to fetch two fields jurisdiction and lineofBusiness and displaying in a read only grid,Currently I am getting data like this

but I want to display only one row,which will have jurisdiction as 44 and all the three line of business in a single cell of column Line of Business

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello,

    You haven't responded for my Answer in other thread? , Anyways I'm gonna ask again , Showing it on a grid isn't a big deal , It's just how you feed your data for the grid is the main concern in your case. Are you grouping your data if so can you tell us your format of data after grouping??

  • 0
    Certified Associate Developer
    in reply to venkat Avuluri

    Hi  ,Sorry for not able to reply in other thread.yes,I am grouping the data.During querying a record, Inside aggregation field I have two groupings one for jurisdictions and other for lineofbusiness,which is stored in local!data.And below is snippet of my code where I am trying to display data in gridfield

  • 0
    Certified Senior Developer
    in reply to mohiniv1048

    Can you paste the  local!data.data format like i want to see you are grouping with jurisdiction field (After grouping are you sure  you only have one row for jurisdiction id : 44 ....)

  • 0
    Certified Associate Developer
    in reply to venkat Avuluri

    is it this which you are looking for?

  • 0
    Certified Associate Developer
    in reply to mohiniv1048

    could you please help me regarding this?

  • 0
    Certified Senior Developer
    in reply to mohiniv1048

    yes , you are not grouping it based on one field (with jurisdiction ref id). If you can do it during querying, it would be good or else i want you to create a map just like what i did in local!dataforGrid (Grouping based on Jurisdiction ref id ). and use it as source for your grid. I used Sample data just for the reference.

    a!localVariables(
      local!data: {
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Bail Bond surity"
        ),
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Credit Guarantee"
        ),
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Legal Expense"
        ),
        a!map(
          jurisdictionrefid: 45,
          lineofBusinessDisplayName: "XYZ"
        ),
        a!map(
          jurisdictionrefid: 45,
          lineofBusinessDisplayName: "ABC"
        ),
        a!map(
          jurisdictionrefid: 46,
          lineofBusinessDisplayName: "PQR"
        )
      },
      local!dataforGrid:a!forEach(
       items:  union(local!data.jurisdictionrefid,local!data.jurisdictionrefid),
       expression: a!map(
         jurisdiction:fv!item,
         lineofBusiness:index(local!data.lineofBusinessDisplayName,wherecontains(fv!item,local!data.jurisdictionrefid))
       )
      ),
      a!gridField(
        data: local!dataforGrid,
        columns: {
          a!gridColumn(
          label:"jurisdiction",
          value: fv!row.jurisdiction
        ),
        a!gridColumn(
          label:"lineofBusiness",
          value: a!richTextDisplayField(
            value: a!richTextBulletedList(
              items: fv!row.lineofBusiness
            )
          )
        )
        }
      )
    )

Reply
  • 0
    Certified Senior Developer
    in reply to mohiniv1048

    yes , you are not grouping it based on one field (with jurisdiction ref id). If you can do it during querying, it would be good or else i want you to create a map just like what i did in local!dataforGrid (Grouping based on Jurisdiction ref id ). and use it as source for your grid. I used Sample data just for the reference.

    a!localVariables(
      local!data: {
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Bail Bond surity"
        ),
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Credit Guarantee"
        ),
        a!map(
          jurisdictionrefid: 44,
          lineofBusinessDisplayName: "Legal Expense"
        ),
        a!map(
          jurisdictionrefid: 45,
          lineofBusinessDisplayName: "XYZ"
        ),
        a!map(
          jurisdictionrefid: 45,
          lineofBusinessDisplayName: "ABC"
        ),
        a!map(
          jurisdictionrefid: 46,
          lineofBusinessDisplayName: "PQR"
        )
      },
      local!dataforGrid:a!forEach(
       items:  union(local!data.jurisdictionrefid,local!data.jurisdictionrefid),
       expression: a!map(
         jurisdiction:fv!item,
         lineofBusiness:index(local!data.lineofBusinessDisplayName,wherecontains(fv!item,local!data.jurisdictionrefid))
       )
      ),
      a!gridField(
        data: local!dataforGrid,
        columns: {
          a!gridColumn(
          label:"jurisdiction",
          value: fv!row.jurisdiction
        ),
        a!gridColumn(
          label:"lineofBusiness",
          value: a!richTextDisplayField(
            value: a!richTextBulletedList(
              items: fv!row.lineofBusiness
            )
          )
        )
        }
      )
    )

Children