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

Multiple Selection in the function update Tool

cgreiner
Retired

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

1 Reply

cgreiner
Retired
I found in the documentation it is not possible to use Multiple Selection on Update Tool "http://doc.mega.com/hopex-v2-fr/#page/MTS2%2FCustomizing_the_UI%2FHOPEX_Forms_-_Forms.3.4.4.6.2_Noti..."