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

How to change Item order in MegaCollection using API

RalfMieke
Super Contributor

Using API, how can you use the MEGA Operator “Order” to reorder Items in a collection automatically?

It would be enough to turn of alphabetic ordering and instead order chronologically:

Calling add(“B”), add(“A”), add(“C”) in order results in the Items ordered A,B,C. We are trying to preserve the order (B,A,C), or manually set it.

How can we do this?

4 Replies

RalfMieke
Super Contributor

This is still not what we wanted to do, but we have found out ourselves:
You have to get the Relationship of each MegaObject in the collection and set its “Order”-Property. The sorting will then be in ascending order of the integers put into “Order”.

ysaury
Retired

Did you use the criteria "order" (manual) or "creation date" (automatic) ?

I think it's working in your case :

Exemple01.png

This is not what we want to achieve. We want to modify the Order (of Book Part Elements) so that the generated Book does not present the Parts in alphabetical order but in the order we specify.

SVanSchoonlandt
Honored Contributor

GetCollection("<name collection>", "<sorting criteria>")

 

eg. GetCollection("Functional Process", "Name")

 

regards

 

stijn