A convenience function is provided, which returns a typed option value.
var value = await client.getOption("XtkDatabaseId");Options are cached because they are often used. It's possible to force the reload of an option:
var value = await client.getOption("XtkDatabaseId", false);
It's also possible to call the API directly.
Use the xtk:session:GetOption method to return an option value and it's type. This call will not use the option cache for returning the option value, but will still cache the result.
const optionValueAndType = await NLWS.xtkSession.getOption("XtkDatabaseId"); console.log("Marketing datbaseId: " + optionValueAndType); Marketing datbaseId: u7F00010100B52BDE,6
If the option does not exist, it will return [ "", 0 ]
var datbaseId = await client.getOption("XtkDatabaseId"); console.log(datbaseId);
The cache can be cleared.
client.clearOptionCache();
It's also possible to set options with the setOption function.
await client.setOption("MyOption", "My value");
This is really a convenience function. You can always force an option type by using a writer on the xtk:option table, and using getOption to read back and cache the result.