I'm using the following to get the object fields for a mapped object:
I'm returned 0 fields found for an object that definitely has fields. My only guess is that the GetFields method only returns the basic view fields (which the object does not have any) and does not return the advanced view fields. Is there a way to return the object's advanced view fields?
There is a difference between "Fields" and "Properties". Can you post a screenshot of the Object Spy of the object you're working with that is not returning fields?
Unfortunately, I can't post a screenshot. However, when looking at the Object Spy for this object, the Fields tab is present and populated with numerous Private and Protected Fields (in Advanced View). When I select the "view basic members (Basic View)" link, the Fields tab disappears. I'm speculating that this is why the GetFields method returns null. Any thoughts?
The other possibility could be a timing issue. Without knowing your code, can't say for sure. But the possibility could be that Aliases.Obj does not exist yet at the time you call "GetFields". So it will return an empty iteration object.
Double check your timing that, when you make that call, that you've waited for the page to load or the object to be instantiated or whatever.
Essentially, aqObject.GetFields does not pay attention to "Basic" versus "Advanced". Those options in the object spy are simply a UI feature for the Object Spy and don't "turn on" or "turn off" properties and methods available to the automation code. So, we need to look for another reason why those Fields aren't showing up.
I should mention I'm using version 12.31 and the object in question is a SWTObject(RibbonSwtCanvas)
GetProperties and GetMethods both work on this object