How to access a profile document in a Notes Db?

I need to store environment information in an app.

In Notes we can use profile documents. Or create a document we can access via a @DBLookup and some generic access key.

But in a service accessing a Notes DB, I can only access a specific document using it's UNID, which is something I'd have to hard code.

Any suggestion how I can do that ?

If you are NOT using a profile document, you could display your config document in a view.
You then could query this view for it's documents via a service, and store the returned information (either the UNID or directly all needed field values) in a table on your form.

Then, you can simply access the first row of the table (as you should have only 1 config document returned) to read the returned UNID or settings.

var tbl = BO.F_Table;
var row = tbl.get(0);
var unid = row.F_ConfigUNID.getValue();
or
var setting1 = row.F_SettingField1.getValue();
var setting2 = row.F_SettingField2.getValue();

1 Like