LiveCode for FM Guide Ben Lui

Named users: Add the Licensing Script Step

Updated Mar 31, 2021

If  your app is going to be deployed to named users, you need to add the script step that allows LCFM Native to license it correctly and collect your users names.

Warning! If you are deploying with a named user license pack, and you do not add this script step, you will not be able to deploy the app.

You can put this script step wherever seems best for your app. A natural place for it is on a login screen, but depending on how your app is structured you might want it to be somewhere else. As long as it is present and collecting user names, it is not important for the functioning of LCFM Native where it is put.

You can see how the script step is used in this very simple sample app.

Create a button and a field

In this very simple example, we have added a button and a field to a layout. The field is named "User" and the layout is named "licenstest". The button is named "Register Named User". We need to add the script step to the button, so that when the user enters their name in the field, they are registered.

Edit Layout

Click on Edit Layout in the top right corner (1), then double click on the Register button (2). You will see a dialog appear, click on the action dropdown menu and choose "Single Step" (3).

Locate the script step

In the scripting workspace, expand "LCFM Native Plug-in" (1) and scroll down to select "Register Named User" (2).

Note: if you don't see these options, please close FileMaker, open LCFM Native and ensure it has run the initialisation that installs the plugin. Re-open FileMaker and you should see the new script steps have appeared.

Add the script step

Double click on the Register Named User script step to add it. Click in the box (1) to bring up the calculation dialog.

We want to pass the value of the user field, in the licensetest table.

Start typing in the name of your layout, in this case, licensetest, and you will see the autocomplete option appears. Select licensetest.

Once you do this, the available fields appear. Select User.

Click ok, then ok again, and you have applied the named user script step successfully.

You can now proceed to deploy your named user app pack when building your LCFM native app.

Note: If you have been editing your solution to add this script step while doing a compile with LCFM Native, remember to close FileMaker again before proceeding with your compile.

Previous Article Buying your first license
Next Article App Identifiers