‎29-04-2013 10:42 AM
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 :
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.
Solved! Go to Solution.
‎07-05-2013 05:00 PM - edited ‎07-05-2013 05:01 PM
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
‎03-05-2013 04:46 PM
Hello,
Is there any way to enable the filtering in API mode ?
regards,
Olivier
‎29-04-2013 01:46 PM
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.