We are currently building a page layout renderer for an offline application that would allow end-user to create records and then sync the data once they get access to internet again.
We need to support the following:
- Page Layout Rendering
- Support FLS
- Custom Labels / Translations
I investigated at the new ui-api and it seems like it would tick all the boxes, however, it is geared towards online apps and seems like it would not be viable for an offline-first app.
Second option I've been looking into is sticking with what the Metadata API has to offer, by:
- Querying Page Layouts individually + their mapping
- Querying the SObject Describe for SObject and Field Describes
- Query Custom Labels
- Query translations
One thing that seems to missing is access to the aggregated Field Level Security. Should a field be visible on the UI? Is it read only? Is it updateable? This is available in Apex using the DescribeFieldResult.isAccessible()
, but when querying it via the metadata API, it seems to exclude isUpdateable, isAccessible and isCreateable...
What are our options to attain this? I feel like our options would be to pull all the Permission Sets / Profiles and merge their settings together, or maybe have an Apex Rest API that would spit out DescribeFieldResult
exposed in Apex...
How can this be achieved (and as friction-less as possible)?