Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Absent Member.. sreedevireddy Absent Member..
Absent Member..
566 views

how to select multiple records from AQL script in Wizard

in AM 5.22,I am using wizard for deleting the records.when I am selecting multiple records for deletion,it allows only one record delete at a time,again we need to select another record.So we have to delete one record at a time by using this wizard.My requirement is , I need to delete all records at a time.

in current wizard, we are using "CurrentSelection" function.for multiple selection which function we are using ? and please let me know the code for multiple selection

 

Thanks,

0 Likes
7 Replies
Priya_B Absent Member.
Absent Member.

Re: how to select multiple records from AQL script in Wizard

Hello Sreedevi, 

 

Which control within the wizard are you using ?  Example the List box / DBlistbox / Dbquery control has the multisel property. 

 

MULTISEL = <TRUE|FALSE>

Specifies whether the control supports multiple-selection (=TRUE) or not (=FALSE).

"Boolean" type property.

MULTISEL=TRUE

HP Support - If this post or any post helps you resolve an issue, please be sure to mark it as an acceptable solution.
Like a post, Please click Kudos to show appreciation !
0 Likes
Trusted Contributor.. Flavio Bianchi Trusted Contributor..
Trusted Contributor..

Re: how to select multiple records from AQL script in Wizard

I assume you are working with client (in webtier theres no multiselect in currentselection).

Whene multiple records are selected [CurrentSelection] gives you all record id separated with a comma:

123,134,156 ecc...

 

A typical use of this is to copy these values in string variable, extract values in a loop and process every single record.

Here is an example:

 

Dim woList As String
Dim lWorkOrderId As Long

woList = [CurrentSelection]

Do while (Len(woList) > 0)
  lWorkOrderID = ExtractValue(woList,",","\")
  '.. do your stuff...
Loop

 

I hope it helps.

0 Likes
Absent Member.. sreedevireddy Absent Member..
Absent Member..

Re: how to select multiple records from AQL script in Wizard

Hi Priya,

 

Please find the below code.

 

'AmMsgBox("sQry: " &"SELECT "
&sSatFKQry &" FROM " &sSatTabName &" WHERE " &sSatPK  &"
= " &[CurrentSelection])
   sSatFKVals = amDBGetList("SELECT "
&sSatFKQry &" FROM " &sSatTabName &" WHERE " &sSatPK  &"
= " &[CurrentSelection] , "|", ",", "=")
   'AmMsgBox("sSatFKVals: "
&sSatFKVals &"    Count: " &CountValues(sSatFKVals, "|",
"\"))

 

 

in this code where can we give the MULTISEL= TRUE

 

0 Likes
Absent Member.. sreedevireddy Absent Member..
Absent Member..

Re: how to select multiple records from AQL script in Wizard

Even though we select multiple records,[Currentselection] variable is accepting one record. We are getting only one record count (only one number displayed ex:123)
0 Likes
Trusted Contributor.. Flavio Bianchi Trusted Contributor..
Trusted Contributor..

Re: how to select multiple records from AQL script in Wizard

Try with a IN option instead of =

 

 

AmMsgBox("sQry: " & "SELECT " & _
         sSatFKQry & " FROM " & _
         sSatTabName & " WHERE " & _
         sSatPK  & " IN (" & [CurrentSelection] & ")")
sSatFKVals = amDBGetList("SELECT " & sSatFKQry & _
                         " FROM " & sSatTabName & _
                         " WHERE " & sSatPK  & _
                         " IN (" & [CurrentSelection] & ")", "|", ",", "=")
AmMsgBox("sSatFKVals: " & sSatFKVals & "    Count: " & CountValues(sSatFKVals, "|", "\"))
 

 

0 Likes
Highlighted
Absent Member.. sreedevireddy Absent Member..
Absent Member..

Re: how to select multiple records from AQL script in Wizard

Hi Priya,



Please find the below code.



'AmMsgBox("sQry: " &"SELECT "
&sSatFKQry &" FROM " &sSatTabName &" WHERE " &sSatPK &"
= " &[CurrentSelection])
sSatFKVals = amDBGetList("SELECT "
&sSatFKQry &" FROM " &sSatTabName &" WHERE " &sSatPK &"
= " &[CurrentSelection] , "|", ",", "=")
'AmMsgBox("sSatFKVals: "
&sSatFKVals &" Count: " &CountValues(sSatFKVals, "|",
"\"))





in this code where can we give the MULTISEL= TRUE
0 Likes
Absent Member.. sreedevireddy Absent Member..
Absent Member..

Re: how to select multiple records from AQL script in Wizard

we tried "IN" option but not coming multiple records ,same problem.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.