cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

any clue why Accessors are always returning null

srinadh_vadlamu
Newcomer

The problem is that the Accessors are always returning null.
For example, the Usexxxx pool (shown below) should return either
“True” or “False” but always returns null. The documentation says that if
the syntax is incorrect the value returned will be “accessor failed” so I think
the syntax is OK.

I'm just trying to get a simple boolean value. Any thoughts and suggestions would be highly appreciated.

untitled.png

3 REPLIES 3

dave_mauney
Dynatrace Champion
Dynatrace Champion

Hi Srinadh,

It looks like you may not have the "()" on the method calls?

You should not have to explicitly call toString(), either.

Examples:

getUser()

getUserContext().getUser()

getUserContext().getUser().toString()

Note that toString() will be called automatically if the object is not a String.

HTH,

dave

srinadh_vadlamu
Newcomer

Hello Dave,

Appreciate your quick response.

I should have been more specific...,
that would be true for java.. but ours are .net property accessors and not methods,
so no parenthesis should be required.. .net properties do compile to methods
and are accessible via reflection.. the method name would be
get_UseCosigner()

We figured it out, The trick was that you had to use the underlying private method name of
“get_UseCosigner()” for that property.

So "()" was actually required, right? 😉 I believe I hit that issue a couple of years ago, but I am more a java guy so I didn't pick up the use of property accessors from the context. Glad you got it working!