In Caché you typically work on objects but you can present them also as rows in an SQLtable.
The identifier for objects is IDKEY if you don't do it yourself it is assigned by Caché.
PrimaryKey is something you assign by your application.

Both are UNIQUE.
And if you define your PrimaryKey as Autoincrement  starting with 1 both are quite likely identical.

That's a basic view. IDKEY has far more variants to be found in documentation.

There is a solution using WIN command  attrib to check read only access flag.
It doesn't write files.
You are welcome to discuss about "elegance" .

 
    set dir=yourDirectory
    set dev="|CPIPE|"
    set cmd="attrib /d "
    set result=""
    open dev:(cmd_dir:"R"):0
    if $test use dev read result close dev
    if $piece($zstrip(result,"<>"," "),dir)["R" write "directory read only",!
    else  write "directory accessible"
,!
 

as all values out of your SQL query come from server you should be able
to setup the content of title on server side as you do for other ZEN components.

#; compopse titel .... into variable mytitle
   set %page.%GetComponentById("Priority").title=mytitle

  


There is  a wide doc on programming ZEN pages
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GZEN

Basically $c(1) s a NONPRINTING character - it has to be invisible by definition.

Instead of WRITE command use ZWRITE to visualize it or $TRANSLATE function to make it visible.

example:

USER>s ^rcc=$lts($lb(123,"abc",23432,"hak","uuk"),$c(1))
 

USER>w ^rcc
123abc23432hakuuk
USER>zw ^rcc
^rcc="123"_$c(1)_"abc"_$c(1)_"23432"_$c(1)_"hak"_$c(1)_"uuk"
USER>ZZDUMP ^rcc
0000: 31 32 33 01 61 62 63 01 32 33 34 33 32 01 68 61         123.abc.23432.ha
0010: 6B 01 75 75 6B                                          k.uuk
USER>write $TR(^rcc,$c(1),"*")
123*abc*23432*hak*uuk
USER>

property onselectrow as %ZEN.Datatype.eventHandler;

onselectrow event handler: This event is fired when a new row is selected. This event is passed a variable, which, which indicates how the row was selected: "", "click" or "keypress".

I'd assume in your case as you did neither "click" nor "keypress"    var which ="" will apply.

So you may use this to ignore the call and return without action.

It would be easier to help you with the concrete call  to ZAUTHENTICATE in hands.

In addition ZAUTHENTICATE.mac needs to be modeled by un-commenting  lines.

Or do you use the pre-configured OAUTH2.AUTHENTICATE.mac

in both cases you need to have activated this line:

Set Properties("Comment")="....whatever you may pass along...."

according to your description this is done .

So the issue might result from the way the call is done
Comment in ZAUTHENICATE.mac Line 90 says:

Properties - Array of returned values, passed by reference

So your call should look like

 Do ^ZAUTHENTICATE(ServiceName,Namespace,Username,Password,Credentials,.Properties)
#;--------------------------------------------------------------------^^^


 It's the dot in front of variable name Properties that does the Pass by Reference and enables you to use the updated array after the call.

The dirty approach would be to name your array %myProp instead of Properties thus using a variable with public scope.

Pls. be more specific on "It is not working."
+ what would you expect to work
eventually you have code and data separated, then it's more than just a single DB
various mapping may add even more DBs

You should get previous releases from WRC based on your service contract.
But be aware: from 2007 to 2017 there have been  15..20 releases.   
Each with changes + release notes that may affect you.