Hi there,
I have created a button to generate CSV file but after clicking on button- page redirects to home page. I want to create document link when clicking on button so that file get downloaded. How can I do this in interface?
Thanks
Discussion posts and replies are publicly visible
Hello manjit.1486,
Does this button trigger a Start process? If so I would recommend you to use a Record/Related actions to perform this and try using a User Input task where the user has a summary of what kind of document and what data is there and so on, add a document download link using a!documentDownloadLink() pass your generated document as the value here. I guess this would help and this is what you were asking for. If not please ignore.
I am using rich text and startprocess link. Want to generate a file document link.
You should display that link only if the document is not null.
I really don't know what's happening.
a!richTextDisplayField( value: a!richTextItem( text:"Dowload Document", link: a!documentDownloadLink( label: document( documentId: if(rule!GLB_isBlank(local!docId),null(),local!docId), property: "name" ), document: if(rule!GLB_isBlank(local!docId),null(),local!docId) ), showWhen: not(rule!GLB_isBlank(local!docId)) ) ),
That depends on what this GLB_isBlank is doing. Why not use a!isNotNullOrEmpty()?
a!richTextDisplayField( value: a!richTextItem( text:"Dowload Document", link: a!documentDownloadLink( label: document( documentId: if(a!isNotNullOrEmpty(local!docId),null(),local!docId), property: "name" ), document: if(a!isNotNullOrEmpty(local!docId),null(),local!docId) ), showWhen: not(a!isNotNullOrEmpty(local!docId)) ) ),
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'document' [line 949]: The passed parameter(s) are of the wrong type. Received the type Text.
You need to check the value of local!docId.
This should not be much of a challenge for a senior developer !?!?!?
Yeah.. let me check
You have a double negative here:
Essentially this is saying to show the rich text item only when local!docId IS empty.
You should be familiar with a!isNullOrEmpty() and its opposite, a!isNotNullOrEmpty() - you would use one or the other of these, but you should never really need to wrap either, especially the latter, in the not() function like you've done here.
This is all you need. The "label" parameter in document download link is irrelevant when used in a rich text item, which just uses the value you place in the "text" parameter. I've removed everything irrelevant here and fixed the aforementioned "double-negative" error.
a!richTextDisplayField( value: a!richTextItem( text: "Dowload Document", showWhen: a!isNotNullOrEmpty(local!docId), link: a!documentDownloadLink( document: local!docId ) ) )
If you want to go slightly fancier you can make use of the super flexible nature of being able to stack multiple a!richTextItem() elements inside one Rich Text Field, and add one that shows up specifically as a placeholder while the Doc ID is still blank:
a!richTextDisplayField( value: { a!richTextItem( text: "Dowload Document", showWhen: a!isNotNullOrEmpty(local!docId), link: a!documentDownloadLink( document: local!docId ) ), /* show a special placeholder while local!docId is still blank: */ a!richTextItem( showWhen: a!isNullOrEmpty(local!docId), text: "(No Document)" ) } )
Awesome, thank you. I was able to achieve the result. Thanks for the help
thanks for confirming - if you're willing, please hit 'verify answer' (etc) when you get a chance.