Skip to main content
swapnar6405
March 11, 2024
Question

Link to download a document in a editable grid.

  • March 11, 2024
  • 5 replies
  • 0 views

Hi,

I have below code in one of the column of a gridLayout control. I am getting an error like

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!forEach [line 24]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function 'document' [line 59]: Document Does Not Exist or has been Deleted. 

I have highlighted the error line in the below code.

a!linkField(
label: "Download document",
labelPosition: "ABOVE",
links: {
a!documentDownloadLink(
label: if(
isnull(fv!item.document),
"",
document( fv!item.document, "name")
) & if(isnull(fv!item.document), "", ".") & if(
isnull( fv!item.document),
"",
document(fv!item.document, "extension")
),
document: fv!item.document
)
}
)

5 replies

mikes0011
Brainy
March 11, 2024

When and how is the document in question being uploaded?

Further, are there any rows with an empty "document" entry?  If so, you'll need to handle nulls.  My recommendation is to not use a!linkfield() for any reason in any location (including but not limited to editable grids), instead you should always use Rich Text Fields with a built-in link, where you control the link to be visible only when the conditions are correct (in this case, a document exists and has already been submitted into the filesystem).

swapnar6405
March 11, 2024

Hi,

The document IDs are there, but still, I am getting the error while performing the "TEST" in designer mode.