SearchConditions: Get list of all objects of certain type

Build 1501 on 14/Nov/2017  This topic last edited on: 29/Aug/2014, at 13:28

Use the below syntax to get list of all objects of given type:

Version 2.0 or newer

Dim sc As SearchConditions = New SearchConditions(Schema.Class.copyrightObj.ObjectTypeName)

Dim list As List(Of IdName) = login.ListObjs(New ExtSearchConditions(sc, login), False, SpikedHandling.Exclude)

Versions 1.6 or older

Dim login As Common.ILogin = Editorial.EditorialLogin.GetLogin()

Dim sc As SearchConditions = New SearchConditions(Schema.Class.copyrightObj.ObjectTypeName)

Dim list As List(Of IdName) = login.ListObjs(sc, False)

The search condition returns a list id,name that can be used in the drop down list.

Remember to add Obj suffix to the object name as you read it in the Schema Editor in EdAdmin4.