Skip to main content
swapnar6405
Known Participant
Mar 12, 2024 1:22 AM UTC
Question

Issue with documentDownloadLink

Hi,

The below line of is working in "Expression Mode" and when I click on "TEST" button during development. But, when I saved and test using browser, I am getting an error like 

{"error":"APNX-1-0000-000","message":"Invalid Content ID","title":"An Error Has Occurred"}.

Any suggessions please.

a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextItem(
text: "download doc",
link: a!documentDownloadLink(document: fv!item.document)
)
}
)

4 replies

konduruc733182
Inspiring
Mar 12, 2024 4:17 AM UTC

Hello [mention:74edcde47e734df8a3f1ea67013709ed:e9ed411860ed4f2ba0265705b8793d05] 

There is no issue in your code. Did you check if your item has valid data. Also did you check if you are indexing the correct field name. Also is this a record data?

Also as Mike has mention in your previous post have a null check to handle blank values. 

If yes, have you tried using

index(fv!item, recordType!recordName.fieldName,null)

tejak2639
Inspiring
Mar 12, 2024 4:49 AM UTC

Hi  [mention:74edcde47e734df8a3f1ea67013709ed:e9ed411860ed4f2ba0265705b8793d05] ,

There is no issue with the code.
But if you are getting error means, may be there is null value in the fv!item.document. So try to handle the null value 
Try if(isNullOrEmpty(fv!item),somedefaultimage,fv!item.document)
If there is no nulls and giving same error means try to use index instead of .document.

dogab0001
New Participant
Mar 22, 2024 8:35 PM UTC

It sounds like the document that corresponds to "fv!item.document" doesn't exist in the system. Make sure all members of the array you put for the "items" parameter of a!forEach() has actually a key called "document" and each value that corresponds to this key is a document that exists in the application.

shubhama926776
Brainy
Mar 30, 2024 12:05 PM UTC

 [mention:74edcde47e734df8a3f1ea67013709ed:e9ed411860ed4f2ba0265705b8793d05] I would suggest you to validate is document present in the system for each iteration.

शुभम्