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

Query , Collection TYPE SELECT

MustaphaJD
New Contributor

Hello ,

i m asking if we can use some syntax like IF  THEN ELSE/IF... when using query (Select implemntation) ? 
if yes, id ont not find some sample on the current documentation.
Thks for your help.

1 Reply

fakhouryy
MEGA Partner
MEGA Partner

Hi Mustapha,

If you want to apply conditional logic to manipulate your query results, you'll have to implement your query via a macro. The if/else conditions will be applied in the macro code.

In the macro code, you'll have to implement the sub "FillSelectionCollection". Example below for your reference (Query: BPA - Get Owner Process From Process):

Sub FillSelectionCollection(mgobjObject as MegaObject, vntSelectorID as Variant, mgcolCollection as MegaCollection)
Dim oBusinessProc,oOrgProc
For Each oBusinessProc In mgobjObject.GetCollection("~5R65VIXKpC10[Process Category]")
mgcolCollection.Add oBusinessProc
Next

Set oOrgProc = mgobjObject.GetCollection("~PzUBSC3C99t0[Owner Process]").Item(1)
If oOrgProc.Exists Then
mgcolCollection.Add oOrgProc
End If

End Sub


Hope this helps!