‎30-11-2016 01:00 PM - edited ‎30-11-2016 02:26 PM
Hello,
We are using the Webclient.
There we have a list of objects.
The User can choose one object or multiple selected objects.
How I can iterate through the list of selected objects?
I have an error on my For Loop because in the logfile i don't see a error report/message
For the test i used the function:
root.CurrentEnvironment.Site.Debug.LogWrite VbCrLf & ">>>>>> Test script" & VbCrLf
My Macro:
'MegaContext(Fields,Types)
'Uses(Components)
Option Explicit
Function AttCtl_GetDefaultKind()
AttCtl_GetDefaultKind = "ComboBoxMenu:SingleOnly"
End Function
Function AttCtl_ImplementsMetaCommand(Context As MegaUpdateToolContext) As Integer
AttCtl_ImplementsMetaCommand = 4
End Function
Function AttCtl_Update(Context, Status, ErrorMessage)
dim mgobjCurrentPerson, root
root = Context.getRoot
Dim selectedObjectsList
Dim selectedObjectsTable
Dim selectedObjectsCollection, x
selectedObjectsList = root.CurrentControl.Value
selectedObjectsTable = Split(selectedObjectsList, " ")
selectedObjectsCollection = root.getSelection
Dim Gegenstand
Dim MyNewObj1
Dim mgobjPerson
Dim Person
Dim VGegenstand
set mgobjPerson = root.getObjectfromID(Context.ValueID)
VGegenstand = Ubound(selectedObjectsTable)+1
MsgBox = VGegenstand
If VGegenstand >1 then
for Gegenstand=0 to VGegenstand
if mgobjPerson.getType.getProp("~c2GvCOkeNHfG[Automatisch Veröffentlichungsgegenstand abonieren 50Hertz]")= "1" then
if Gegenstand.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").Count = 0 then
set MyNewObj1 = Gegenstand.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").Create
End if
set Person = Gegenstand.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").item(1)
Person.getCollection("~CAMX(l8AIDtB[Subscriber]").add mgobjPerson
End if
next
Else
if mgobjPerson.getType.getProp("~c2GvCOkeNHfG[Automatisch Veröffentlichungsgegenstand abonieren 50Hertz]")= "1" then
if Context.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").Count = 0 then
set MyNewObj1 = Context.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").Create
End if
set Person = Context.megaObject.getCollection("~I9MXRU8AI9QB[Root Subscription]").item(1)
Person.getCollection("~CAMX(l8AIDtB[Subscriber]").add mgobjPerson
'mgobjPerson
End if
Status = 4
End if
' AttCtl_Update = False
End Function
Thanks and regards Caroline
Solved! Go to Solution.
‎08-12-2016 04:27 PM