#Document in PagingGrid We have a requirement to show data in paging grid a

#Document in PagingGrid
We have a requirement to show data in paging grid along with document link.
when I am showing data(fetching from DB) in the Paging grid it only shows document id. How to show the document as attachment in the paging Grid , I tried to use todocument and linktodocument function but the document link is not displayed. I am working on v7.3

Thanks in advance

OriginalPostID-147939

OriginalPostID-147939

  Discussion posts and replies are publicly visible

Parents
  • Try using the following method.
    Create 2 rules for generating the document name and a download link for a given document Id.
    Let's say rule!GetDocumentName as

    document(
    ri!DocumentId,
    "name"
    )

    and

    rule!GetDocumentLink as

    a!documentDownloadLink(
    document: ri!DocumentId,
    label: document(ri!DocumentId,"name")
    )
                        
    Now, in your grid use the following code snippet.

    a!gridTextColumn(
    label: "Document",
    field: "documentId",
    data: apply(
    rule!GetDocumentName,
    index(
    local!DataSubset.data,
    "documentId",
    {}
    )
    ),
    links: apply(
    rule!GetDocumentLink,
    index(
    local!DataSubset.data,
    "documentId",
    {}
    )
    ),
    alignment: "LEFT"
    )
                        
    Here "documentId" will be your CDT field for document Id.
Reply
  • Try using the following method.
    Create 2 rules for generating the document name and a download link for a given document Id.
    Let's say rule!GetDocumentName as

    document(
    ri!DocumentId,
    "name"
    )

    and

    rule!GetDocumentLink as

    a!documentDownloadLink(
    document: ri!DocumentId,
    label: document(ri!DocumentId,"name")
    )
                        
    Now, in your grid use the following code snippet.

    a!gridTextColumn(
    label: "Document",
    field: "documentId",
    data: apply(
    rule!GetDocumentName,
    index(
    local!DataSubset.data,
    "documentId",
    {}
    )
    ),
    links: apply(
    rule!GetDocumentLink,
    index(
    local!DataSubset.data,
    "documentId",
    {}
    )
    ),
    alignment: "LEFT"
    )
                        
    Here "documentId" will be your CDT field for document Id.
Children
No Data