Hi Alp, you're heading in the right direction, and your concerns are valid. Let's break it down and get you on a clean, scalable path for your NewsApp using Mendix Native Mobile best practices.
Problem Summary:
You're converting News (persistent) to News_NPA (non-persistent) to reduce sync load smart.
What You Have:
News (Persistent) – Real data from web panel.
NewsAttachment (Persistent) – File uploaded, linked to News.
News_NPE (Non-Persistent) – Used in Native Mobile to show News (great!).
NewsAttachment_NPE (Non-Persistent) – For showing/download file info (also good).
At app start (or when needed):
Run a microflow:
Retrieve a list of News (limit to 20 or filter).
For each one:
Create a News_NPE.
Set its values (title, publish date, etc.).
Optionally check if NewsAttachment exists → Set haveFileDocument = true.
You can skip creating NewsAttachment_NPE at this point to save time.
This gives you a light, fast list on the mobile screen.
When user wants to view/download attachment:
Call a microflow with the News ID.
Microflow:
Retrieves News by ID.
Retrieves related NewsAttachment.
Returns NewsAttachment (FileDocument).
Native client:
Uses Download or OpenFileDocument to show it
Bonus Tip:
If you want to preview the file name before download:
You can add a “Get Attachment Info” microflow that returns a NewsAttachment_NPE with:
name and base64 or URL.
I hope this one helps you! :)