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

API - hidden objects

OBories
Contributor

Hello,

 

I'm trying to figure out why i have different behavior between a query in mega and the same in API.

 

My query is the following :

Select [MetaClass] Where [MetaLayer] ="30" 
		And [Name] Like "A#"

 The result (in mega) is this :

img_mega.png

I have 34 hidden items, in the API macro i see everything.

Here are my questions :

 

1) To what is it linked ?

2) How can i get the same objects as the query in mega in my API script (i suppose there are some hidden filters ?)

 

Thanks.

3 Replies

There is an advanced syntax

MegaRoot.SetDefault ("parameter ").

 

Various parameters are available that are documented in MEGA Exchange - API EN.pdf (search for the string '@' to get the appropriate section)

 

Example in VB script that you can run in the script editor

Set MyRoot = GetRoot()
Print MyRoot.Name
Set cMetaClassWithoutFilter = GetRoot.GetCollection("~P20000000c10[MetaClass]")
Print "Number of MetaClass (metamodel filter disabled): " & cMetaClassWithoutFilter.Count
MyRoot.SetDefault("@ACTIVATEMETAFILTER")
Set cMetaClassWithFilter = GetRoot.GetCollection("~P20000000c10[MetaClass]")
' this number should match the number returned by the query tool
Print "Number of MetaClass (metamodel filter enabled): " & cMetaClassWithFilter.Count

 

 

 

Jerome

Hello,

 

Is there any way to enable the filtering in API mode ?

 

regards,

 

Olivier

jhorber
MEGA
MEGA

Hello OBories

 

Such differences are usually related to confidentiality or product filtering.

 

In this case, it is likely that the MEGA user running the query in interfactive mode runs a licence that does not enable to see all the 34 MetaClasses. If this is confirms, the behavior is the expected behavior.

 

API functions usually ignore product filtering.

 

Jerome