Link to download a document in a editable grid.


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.

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

  Discussion posts and replies are publicly visible