Parsware
All articles

Model-driven apps

Your first app, shared with the people who need it

Building an app doesn't give it to anyone. Share it with a role, check who that actually reaches, and the app appears on their launcher and nobody else's. The sharing travels in the solution, so you don't redo it in every environment.

The Who can use Field Sales panel in dark mode, with the Field Sales role ticked, next to the title "Your first app, shared"

You've built an app. Now the sales team needs it, and the finance team doesn't. A new app is visible to makers and administrators and to nobody else. That is the only safe default. This article covers the step that hands it over.

To follow along, import the An app that arrives shared with the people who need it sample from the platform's sample solutions. It brings a Field Sales app for accounts and contacts, and a Field Sales role that opens it. Every picture is the real product.

An app is a navigation over tables

Open the solution's Apps and select Field Sales. An app is a set of groups, each listing the tables, reports or screens its people work in, and a home page it opens on:

The Edit app drawer for Field Sales: a Customers group holding Account (labelled Accounts) and Contact (labelled Contacts), with Add group below and Home page set to Account

Each table's entry says how many of its forms and views the app offers. The next article is about those.

Share it with a role

Select the app's row and press Share. The panel asks which roles the app is for:

The Who can use Field Sales panel: Field Sales ticked in the roles list, a note that Maker can already open every app in this environment, and People who get it (2) listing Robin Park and Sam Taylor

Field Sales is already ticked, because the sample brought the grant with it. Underneath, People who get it turns the roles into names: here Robin Park and Sam Taylor, who hold the role. That list is the check that matters. Straight after the import it said Nobody holds the roles you have chosen, so nobody gets the app yet, because nobody had been given the role. Without it, sharing with an empty role looks exactly like success.

The note about Maker is there because makers can open every app in the environment. A maker who couldn't open the app they had just built would think the environment was broken.

Give people the role

Roles are given to people under Users. Select a user, choose Manage roles, and tick the role:

Roles for Robin Park, with Field Sales (par_field_sales) ticked among the tenant's roles

Save, and the person appears under People who get it in the Share panel.

What they see

Robin signs in to the Shell, and the launcher shows the one app that was shared with them:

Robin's launcher: Apps in Development, with a single Field Sales tile

The environment has ten other apps, and Robin sees none of them. If a colleague sends Robin a link into one of them anyway, the Shell says so plainly rather than pretending the app doesn't exist:

That app hasn't been shared with you. Ask whoever looks after your apps to share it with a role you hold. Back to Apps

"Not shared with you" and "not here" are different facts, and each sends the person to a different place.

Studio apps are shared the same way, with a Share button on the Studio apps list and the same panel.

The app and the role, as the solution carries them

The sample is two documents, and reading them shows exactly what sharing means. The first is the app: a name, an icon, a home page and the navigation.

{
  "logicalName": "par_field_sales_app",
  "displayName": "Field Sales",
  "publisherPrefix": "par",
  "icon": "briefcase",
  "home": { "type": "Entity", "target": "account" },
  "navigation": [
    {
      "title": "Customers",
      "items": [
        { "type": "Entity", "target": "account", "displayName": "Accounts", "icon": "briefcase" },
        { "type": "Entity", "target": "contact", "displayName": "Contacts", "icon": "users" }
      ]
    }
  ]
}

The second is the role. It says nothing about the app's screens; it lists permissions, and the first of them is the one Share ticks:

{
  "logicalName": "par_field_sales",
  "displayName": "Field Sales",
  "permissions": [
    { "permissionName": "par_field_sales_app.Open", "policyName": "Organization" },
    { "permissionName": "account.Read", "policyName": "Organization" },
    { "permissionName": "account.Create", "policyName": "Organization" },
    { "permissionName": "account.Update", "policyName": "Organization" },
    { "permissionName": "contact.Read", "policyName": "Organization" },
    { "permissionName": "contact.Create", "policyName": "Organization" },
    { "permissionName": "contact.Update", "policyName": "Organization" }
  ]
}

Seven lines, two jobs. par_field_sales_app.Open puts the app on the launcher. The other six let the people who open it read, create and change accounts and contacts. There is no Delete, so a field salesperson can't delete a customer by mistake; the command simply isn't offered to them.

Organization says the permission covers every record in the environment. A role can be narrower, for example only the records a person owns, and Record access: whose records you see explains the choices.

Opening the app is not reading the data

This is the part people most often get wrong the first time, so it is worth saying twice. Share grants Open on the app. It grants nothing on the tables.

The role has What the person sees
Open on the app, and Read on its tables The app on the launcher, and records in it
Open on the app, but no Read on a table The app opens, but the platform refuses to list that table's records
Read on the tables, but no Open on the app No tile on the launcher, and a link to the app is refused
Neither Nothing at all

The two are separate on purpose. One table is often in several apps: accounts appear in Field Sales, in Finance and in Support. Whether somebody may read accounts is one decision about the data; which apps they use to do it is another, about their job. Keeping them apart means changing somebody's job doesn't change what data they may see, and the other way round.

What goes in an app's navigation

A navigation group can list more than tables. The kinds of entry the sample solutions use:

  • A table, which opens on its default view, as Accounts does here.
  • A report, which opens the report with live data and a Print button. A report inside an app adds one.
  • A Studio app screen, a drawn screen opened inside the model-driven app. Open a Studio app inside a model-driven app shows how.
  • A dashboard, for apps that already have one.

Group them for the job, not for the database. A Customers group holding accounts and contacts, and a Pipeline group holding leads and opportunities, reads better than one group with every table in alphabetical order. The home page is whatever people need first thing in the morning, usually the list they work through.

A role for each job

Most environments end up with a handful of roles, each matching a job, and each opening the apps that job needs.

Role Opens Can do in its tables
Field Sales Field Sales Read, create and change accounts and contacts
Sales Manager Field Sales, Pipeline Reports The above, plus delete, plus read every opportunity
Finance Finance Read accounts; read and change invoices
Support Support Read accounts and contacts; create and change cases

A person can hold several roles, and gets everything each allows. A team lead in sales might hold Field Sales and Sales Manager. Roles can also be given to a team, so everybody in the team gets them; Teams explains when that is easier.

Sharing in Test and Production

Because the grant is a permission inside the role, and the role is in the solution, the app arrives shared wherever the solution is imported. What doesn't travel is who holds the role, because people are not the same in every environment. After the first import into Production, an administrator gives the role to the right people there, once. Every later upgrade keeps those assignments.

The Share panel is the place to check afterwards. If People who get it says nobody, the app is shared with a role nobody has yet.

Questions that come up

Can I share an app with one person without a role? No. Sharing always goes through a role, so that what a person may do is written in one place, the Roles screen, and travels in the solution. A role with one member is fine.

Can I hide one table of an app from some of its users? Leave Read on that table out of their role. They still open the app, but its records are refused to them, whichever screen asks. If a whole group of people never needs a table, a second, smaller app for them is usually clearer.

Do makers need the role to test the app? No. Makers can open every app in the environment, which is why the Share panel mentions it. To see the app exactly as a user will, sign in as a test user who holds only the role.

Try it

With the sample imported and one test user who isn't a maker:

  1. Open Apps, select Field Sales and press Share. Read People who get it: nobody yet.
  2. Under Users, give your test user the Field Sales role.
  3. Back in the Share panel, the test user is now named.
  4. Sign in as the test user. The launcher shows one tile, Field Sales, and opening it lists the environment's accounts.
  5. Open an account and look at the command bar. There is Save, but no Delete, because the role doesn't grant it.
  6. As a maker, untick Field Sales in the Share panel and save. On the test user's next visit the launcher is empty, and a bookmarked link into the app says it hasn't been shared with them.

Six steps, and every rule of this article shows itself: the app's tile comes from Open, the records from Read, the missing button from the missing Delete, and the refusal from a link that outlived its permission.

Why a role, and not a list of names

Sharing an app grants one permission, par_field_sales_app.Open, to each role you tick. It is an ordinary permission, so:

  • it appears on the Roles screen with everything else the role can do;
  • it travels in the solution, which is why the sample arrived already shared. Promote the app from Development to Test and its sharing comes with it;
  • uninstalling a managed solution takes back only what that solution granted. Anything an administrator ticked stays.

Sharing an app doesn't let people read its tables. That comes from the role's own permissions on those tables, which the sample's role also includes.

Next: forms that fit the job, with tabs, sections and columns, and more than one form for a table.