Question
How to configure default document
Hi,
my requirement is to set the default document so i have taken value from my database which i have already uploaded and i used those values into the linkfield with a!documentDownloadLink but still i unable to see the document can you please help me where i went wrong, Below is my code.
a!localVariables(
local!text:"Please refer these document and send your reply soon",
local!newGrid:'type!{urn:com:appian:types:SHA}SHA_receivedDocuments'(),
local!emailSubject:"Sending mail regarding Property Documents",
local!document:40915,
local!docName:"Dummy Document",
{
a!sectionLayout(
label:"",
contents: {
a!richTextDisplayField(
labelPosition:"COLLAPSED",
value:{
a!richTextIcon(
icon:"file-text",
color:"ACCENT",
size:"LARGE"
),
a!richTextItem(
text:"Document",
color:"SECONDARY",
size:"LARGE",
style:"STRONG"
)
}
)
},
divider:"BELOW"
),
a!gridLayout(
headerCells: {
a!gridLayoutHeaderCell(label:"Upload Document",align:"CENTER"),
a!gridLayoutHeaderCell(label:"Document Type",align: "CENTER"),
a!gridLayoutHeaderCell(label:"Document Description ",align: "CENTER"),
a!gridLayoutHeaderCell(label:"Action")
},
columnConfigs: {
a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
a!gridLayoutColumnConfig(width: "ICON" )
},
rows:{
a!forEach(
items: ri!documents,
expression: a!gridRowLayout(
contents: {
if(
rule!FCO_hasValue(fv!item.receiveDocId),
a!fileUploadField(
label: "File Upload",
labelPosition: "ABOVE",
target:cons!SHA_FOLDER,
maxSelections:1,
value:fv!item.receiveDocId,
saveInto: fv!item.receiveDocId,
required: true(),
),
a!linkField(
links: {
a!documentDownloadLink(
label: local!docName,
document:todocument(local!document)
)
}
),
),
a!dropdownField(
label: "Document Type",
labelPosition: "ADJACENT",
placeholder: "Select the type of document",
choiceLabels:cons!SHA_TYPESOFDOCUMENTS,
choiceValues:cons!SHA_TYPESOFDOCUMENTS,
value:fv!item.docType,
saveInto:fv!item.docType,
),
a!textField(
label:"Document Description",
placeholder:"Enter document description",
value:fv!item.docDescription,
saveInto:fv!item.docDescription,
),
a!richTextDisplayField(
label: "Rich Text",
labelPosition: "COLLAPSED",
value: {a!richTextIcon(
icon: "trash",
link: a!dynamicLink(
saveInto: a!save(ri!documents,remove(ri!documents,fv!index)
)
),
size: "STANDARD",
color:"NEGATIVE",
)},
)
}
)
),
},
selectionValue: ri!documents,
selectionSaveInto: ri!documents,
addRowLink: a!dynamicLink(
label: "Upload file",
value:true(),
saveInto:{ a!save
(ri!documents,append(ri!documents,{local!newGrid}))
} ,
),
),
}
)
