Okcancellistmulti

Is there anyway of figuring out what element of an array is selected when using WORKSPACE.PROMPT(PROMPT_OKCANCELLISTMULTI…?

I have an agent to delete an agent id, which presents the user with a list of current id’s and asks them to select which one(s) to delete. Currently, after the input, I cycle through the array and get the index number by comparison…this causes a problem if there are duplicate entries and they only want to delete one. Here’s my current code:

 set curagent=doc.getfirstitem("agentid")

  dim agx as variant

  set agx=curagent.values

x=workspace.prompt(PROMPT_OKCANCELLISTMULT,"ID Select","Please select the ID's you want to delete",agx(0),agx)

	If Isempty(x) Then Exit Sub

	For i=0 To Ubound(agx)

		checkit2=Arraygetindex(x,agx(i))	

		If  Not Isnull(checkit2) Then

			Set doc2=New notesdocument(thedb)

			doc2.form="change"

			doc2.serial=doc.serial(0)

			doc2.country=doc.country(0)

			doc2.end=Now

			doc2.actdate=Now

			doc2.agentid=agx(i)

			doc2.switchid=swx(i)

			doc2.acdchange="yes"

			Call doc2.save(True,True)

			agx(i)=""

			swx(i)=""

		End If

              next