Select item in list box using code

We use Adobe Workflow v5. I am creating a Check Request application where users type information into various fields and when they click Add, the data is added to a List Box. Also when they click Add, if the current item is >$1,000, a query searches our accounting database to see if the client has outstanding AR older than 90 days. If they do, another list box is displayed with the client name and amount of outstanding AR.
If that clientnum is already in the second list box, it does not add another one.
To delete a record from the first list box, the users select the item in the first list box, and then click a Delete button. That deletes the
record in the first list box.
I am also trying to delete the record from the second list box but am not sure how to select it using code. As part of the Delete button code, if the currently selected item (the one they want to delete) is >$1,000, I go through each row of the first list box to see if clnum.text (field in the form where the record to be deleted is now displayed) matches the client number in column 4 of any row of the first list box. If it does, I see if the amount of the item in the first list box is >$1000.
If it is, then I know that there is a corresponding record in the second list box.
Here is some of the code:
'go through each row in first list box
For irow = 1 to lstExp.ListCount
'set clientnum variable equal to client # in row in first list box
clientnum = lstExp.RetrieveItem(irow,4)
'if clientnum variable is equal to client # to be deleted from first list box (selected record - client # in clnum.text now)
if clientnum = trim(clnum.text) then
'if amt is >$1,000 in first list box
if lstExp.RetrieveItem(irow,10) > 1000 then
'don't delete row because there is another record in first list box
DeleteOutAR = "N"
else
'delete row because there is NOT another record in first list box.
DeleteOutAR = "Y"
end if
end if
Next
Here is the code I need help with. I am unsure how to select the record in the second list box so I can delete it.
if DeleteOutAR = "Y" then
'go to second list box ?
form.GoToField(lstOutARUnbilled)
'start going through second list box looking for clientnum
For irow2 = 1 to lstOutARUnbilled.ListCount
if clientnum = lstOutARUnbilled.RetrieveItem(irow2,1) then
irow2 = lstOutARUnbilled.CurrentSelection
lstOutARUnbilled.Removeitem (irow2)
end if
next
end if
So my question is, how can I move to the second list box to actually delete the record?
Thank you in advance for any help.
Mary

Mary-
The solution could either be quite easy or difficult dependent upon how the data is arranged in the subsequent list box.
Basically, if there is any sort of corresponding or matching entries, meaning line 1 from list box #1 matches with line 1 of listbox #2, then you would simply execute the following...
"listbox#2.RemoveItem listbox#1.CurrentSelection"
Or if you have a column that would contain the same values, say an index, then you could just loop thru the 2nd listbox searching for that index and once found remove the line...
"listbox#2.RemoveItem nRow"
, where nRow would be the line that you discovered to have the matching index.

Similar Messages

  • The method of leaving cursor at selecting item of list box.

    Hello.
    Pleas let me ask about the subject!!!
    Concerning the screen by web-dynpro, I have a problem that when I select one listbox after selecting another listbox, the screen moves up to the top automatically.
    I would like to prevent from above moving.
    Could anyone specialist please tell me how leaving cursor at setelcting item of the list box.
    Thanks!!!

    Hi...
    there are two events which have been used, one is doubleclick event and the other one is on selecting the item from the list and clicking on OK button(this will be the most frequently used function, i cannot use event target event for this OK button... ) . I have attached the screen shot. Please have a look at it and let me know how can i achieve that...
    I can use custom event, but the main problem is that the inline itemeditor's details are not accessible in the code.... I can access some function from within the inline itemeditor combo box using outerDocument.myFunction() (this is something like GET). Is there a similar way, to SET the data into this itemeditor?

  • How scroll through a list of items in list box with code in C# winforms to create auto scrolling

    I am new to programming and I have been tasked to create a form to display information in list box controls on a big screen. The list boxes have to show all data by auto scrolling through all data row by row then start again at the top once it has displayed
    all data. Is there a way to do this automatically in code using a timer? I look all over the web and have not found any way to do this in win win forms. Is it possible?
    Thanks 

    Here's the c# code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    namespace WindowsApplication13
    public partial class Form1 : Form
    System.Timers.Timer timer = new System.Timers.Timer();
    int position = 0;
    public delegate void delegateUpdateListbox();
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    timer.Interval = 1000;
    timer.Enabled = true;
    timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
    void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
    position += 1;
    if (position == listBox1.Items.Count)
    position = 0;
    delegateUpdateListbox deleg = new delegateUpdateListbox(updateListbox);
    this.Invoke(deleg);
    void updateListbox()
    listBox1.SelectedIndex = position;
    As long as the listbox's SelectionMode is set to "One" (the default), you don't have to do anything to un-select the previous item.
    For your secnd question, the code inside the timer checks whether the position is the same as the length of the contents of the listbox and resets its value to zero, so that the selection will go back to the first item in the list.

  • How to get the display value of selected item in list box?

    I have a page with an HtmlSelectOneListbox that is filled with an ArrayList of SelectItem objects.
    The SelectItem objects contain a Key and Value. The Value is displayed in the ListBox.
    The value parameter of the listbox is bound to a bean property which is called selectedListItem.
    The bean property selectedListItem contains the Key of the SelectItem that is selected.
    How do I obtain the Value of the selectedListItem?
    I need to be able to get the Value field that is displayed, not just the Key to the item that is displayed.
    Edited by: burferd on Nov 3, 2007 10:03 PM

    How are you filling in the value of the menu? Obtain it back by the same way. Or pass it along the key in a object.
    This article may give useful insights: http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html

  • Help needed in removing duplicate items of list box  in java

    How to remove duplicate items of list box while dynamically inserting (on-click event)
    It is not identifying duplicate data
    Variable name is HP_G1
    HP_dmg1 = (DefaultListModel) HP_G1.getModel();
    int a = HP_G1.getModel().getSize();
    System.out.println("HP list no--------> "+a);
    if(a!=0)
    for (int j=0; j<a; j++)
    String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
    System.out.println("HP list added--------> "+item1);
    if(HP_dmg1.equals(item1)){
    HP_dmg1.remove(j);
    else
    HP_dmg1.addElement(GPL);
    }

    Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
    As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

  • Strange bug, items in list boxes disappearing

    First of all this is my first post here ever. If its a wrong forum, sorry.
    So ever since I installed Windows 8.1 here (fresh install), I have this strange bug were items in list boxes start disappearing when you open a window with them.
    It didn't bother me much but now its horrible when I wanted to switch my playback device... Or if you want to change IP settings on my network adapter.
    The thing is it all happens in a very short period of time so it took me a while to get screens of it and here they are:
    s9.postimg.org/dvqvulc5b/bug.gif
    s9.postimg.org/a0nhs0szj/bug2.gif
    I still can't upload images on this forum!
    That is real time of how it appears on my screen when I open those windows. You can see on the first image that the window is still appearing.
    I have searched for this problem but couldn't find anything.
    Lenovo Z510 Notebook

    try to use default Windows 8.1 theme
    try to check with different account
    try to check in safe mode
    try to find if there is any graphic driver update or any driver update, compare your version
    http://support.lenovo.com/en_HK/downloads/detail.page?DocID=DS037055
    try to update your windows
    monitor event viewer if there is any abnormal behavior
    try to check using PSR
    http://windows.microsoft.com/en-hk/windows7/how-do-i-use-problem-steps-recorder
    update your windows if there is any windows update

  • Counting the number of values selected in a list box

    I'm trying to add a counter to a form that tells the user how many values have been selected from a list box... I tried adding a FormCalc formula to a calculate event in the "counter" field as follows:
    count(form1.#subform[0].ListBox1.rawValue)
    But for some reason it's not adding them up. It only gives me a value of 0 when none are selected, or 1 where any number of selections are made.
    Can anyone help me out?
    Thanks in advance

    Try putting this in the calculate event of your counter field:
    var num=0;
    for (var a=0;a<ListBox1.items.nodes.length;a++){
    if (ListBox1.getItemState(a))
      num++;
    this.rawValue=num;
    Exit the list box and the field will calculate.
    Kyle

  • How to create an alert at the list item of List box in vbs/c sharp

    Dear All,
    I need to know how can we create an alert, or a message on the execution of the last item in the List box.

    What do you mean by "on the execution of the last item in the list box"? Do you mean when that last item of a ListBox is selected? If so, you could use the following code:
    Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) _
    Handles ListBox1.SelectedIndexChanged
    Dim lb As ListBox = CType(sender, ListBox)
    If lb.SelectedIndex = lb.Items.Count - 1 Then
    MessageBox.Show("Last item is selected")
    End If
    End Sub

  • Selecting item in combo box itemEditor, after passing it's dataprovider from a popup window

    Hi..
    I have a datagrid which has a combo box itemeditor in the first column. When I click on the combobox, there is an item called 'Search'. When this is selected, a pop up window appears where we can search for some contact names. The search results are populated in List component, within the pop up and on double click of any of the names from the list, all of the list content is passed on as dataprovider to the combobox itemeditor of the grid. It works fine till here. Now, how can I highlight the selected name(name on which I double click, in the list of the pop up window), as the 'selectedItem' of the combobox itemeditor? ie., as soon as I double click the name, that name should appear on that combo box. As of now, wehn I double click, the search result names are passed on as dataprovider to the combobox, but a blank entry will be selected in th combobox, instead of the selected name from teh list of the pop up window. Can you please help me out on how to achieve this? I had been cracking my head for 2days now, hasn't worked out yet for me

    Hi...
    there are two events which have been used, one is doubleclick event and the other one is on selecting the item from the list and clicking on OK button(this will be the most frequently used function, i cannot use event target event for this OK button... ) . I have attached the screen shot. Please have a look at it and let me know how can i achieve that...
    I can use custom event, but the main problem is that the inline itemeditor's details are not accessible in the code.... I can access some function from within the inline itemeditor combo box using outerDocument.myFunction() (this is something like GET). Is there a similar way, to SET the data into this itemeditor?

  • Can't delete multiple selected items in List or Library

    I am experiencing quirky behavior when attempting to delete multiple selected items from a library or list. I select a few items via check box for each item I would like to delete. Then I click the delete button in the ribbon, and all I get is "Deleting...",
    but no page refresh and the items are not deleted. However if I access the same list or library via the App server and select a few items, then hit delete, the page refreshes and the items are deleted.
    So I consulted the Logs and compared the Web Server vs App Server, and the there is a lot of cryptic entries. The few lines that stands out most to me is the App server is:
    ConnectionString: 'Data Source=database;Initial Catalog=Content;Integrated Security=True;Enlist=False;Asynchronous Processing=False;Connect Timeout=15'   
    ConnectionState: Closed ConnectionTimeout: 15
    In fireItemEvent(), for list Building Locations, and item: 1
    In fireSyncItemEvent(), calling ExecuteItemEventReceivers()
    Calling ExecuteItemEventReceivers() for list 0f773535-3b22-4c29-97f1-fd2b70b50dd3 on item 1
    Entering monitored scope (Event Receiver (Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, Microsoft.SharePoint.Publishing.Internal.PublishingWebEventReceiver))
    Releasing SPRequest with allocation Id {FE9A45A8-C042-4223-8FCC-4BD873C93885}
    PublishingWebEventReceiver:ItemDeleting: item 
    These calls are not in the web server log.
    The list I was doing the delete action on was "Building Locations". We are using claims based authentication
    Thanks for any insight or thoughts.
    Brandon

    I confirmed that there is no rewrite tags in either web config (app or web).
    I did download fiddler, and when I try and delete on the web front end I get:
    It tries to access the URL https://mysite/_layouts/_vti_bin/client.svc/processQuery
    Then it sends me here since I have been denied
    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="https://mysite/_layouts/AccessDenied.aspx">here</a>.</h2>
    </body></html>
    The app server goes to
    http://mysite/_layouts/_vti_bin/client.svc/processQuery doesn't get denied and deletes the items.

  • Adobe LiveCycle Designer 7.0 - Don't have Multiple Select option for List Box

    I've created a form and need to add a List Box that will allow the user to select Multiple items in the box. I do not have the option under the Object property to set this option. Can anyone explain why I don't have this option and how I can activate it?

    Ian,
    I don't know if you can use a PDF form to do an HTTP upload of a file. You can use an image field to allow a user to browse for a GIF, TIF, JPG, or PNG and include that in the submitted XML, but I don't know if it's possible to do something similar for other file types. I doubt it. PDF does support file attachments, but that functionality requires the user to have Acrobat or the PDF has to have usage rights enabled using Adobe Reader Extensions Server. Even if you assume that all your users have Acrobat though, attaching files in this way doesn't get the file into the XML form data like an image field does.

  • HOw to add list box using enhacement of standard infotype

    Hi,
    Using enahancement infotype, I wanted to add a list box field in inftyp 01.
    The module pool ZP000100 & screen no 200 already existed .In the layout editor the field didnot get displayed hence I took it from dictionary.
    I have adde the code in pbo & pai for adding values in list box.
    problem is that data is not getting saved when i enter data in pa30 inftyp 01.
    Kindly guide me.
    Regards,
    Rachel

    *

  • List box using ms access db

    hi
    can any body help me. i m trying to make a list box which takes options
    by a ms access database. plz tell me how can i display the db in the list box or combo box.
    thanks in advance

    Something like this:
    <%
    // you need code to get data from database into resultSet() called rs .............
    rs.next(); // move to first record in resultSet()
    %>
    <select name="day">
    <option selected><font face="Arial, Helvetica, sans-serif"><%= rs.getString("yourDbColumn") %></font></option>
    <%
    while rs.next(){  // loop the rest of the records
    %>
    <option><%= rs.getString("yourDbColumn") %></option>
    <%
    } // close the while looop
    %>
    </select>

  • Drop Downl list box using model binding

    Hi friends
       I observed one thing that for drop down list box if we set the attribte 'helpValues' using Model Data Binding. Then the list is showing if the search help assigned to field or data element contains only 2 fields.
        For example in SFLIGHT table drop down list box shows for 'CARRID' Field not for 'CONNID' .
        The same problem for get_simple_helpvalues2() method also.
        Is it right ? or Wrong?

    That is a limitation of those methods that I have observed as well.
    Recently I picked through the code of get_simple_helpvalues2.  I am currently using in my Value Help Custom Extension (along with the BAPI for HELP_VALUES).  I wanted something simpler to use than the BAPI, but with more functionality than get_simple_helpvalues2.  I used some of the code from get_simple_helpvalues2 and extended it to support any elementary search help (it works for both CARRID and CONNID).
    I used calls to DD_SHLP_GET_HELPMETHOD and DD_SHLP_GET_HELPVALUES.  The end result is quite a bit of code, but once completed very easy to reuse.  I hope to update the example I have on SDN for Value Help with this additional solution, but I have been quite busy trying to get ready for TechED.  Also I have a few bugs left to work out in my method.

  • How can I export multiple selections in a list box into a .csv file?

    Hi all, I've created a form in Acrobat X with a list box enabled for multiple selections. When I try to export the filled out form into a .csv file, only the first selection shows up. Can anyone help me figure out how to get all selections to export? Thanks!

    Thank you for your quick response!
    Once a recipient fills out the form (which has two questions with list boxes and multiple selection enabled) they send the completed form back to me. When I open the completed form, I am given the option add the completed form to a reponse file which was set up when I distributed the form. When I open the reponse file, it lists all of the responses in rows, and the values that were chosen in the form are arranged in columns. In this file, the list boxe columns have multiple values, separated by commas (which is what I'm looking for). At this point there is an option to export into a .csv file or an .xml file. If I choose the .csv file and open in excel, only the first selection shows in the list box column rather than all selections that were initially made by the responder.

Maybe you are looking for

  • Can't install a extension

    Hi, guys. I'm trying to install an important extension on Adobe Extension Manager CS3. But, whenever I try to install a extension, a window pops up claiming that I need "Flash 6 or higher", yet, I do indeed have Adobe Flash CS3. It's a portable versi

  • 520-1030A unresponsive

    Newly purchased 520-1030A is unresponsive when trying to start third party software (eg CloneDVD) via keyboard/mouse -not supplied wireless but a microsoft wired job.  Even touch screen does nothing. You can double click the icon on desktop as much a

  • Combining several songs into one album

    I have numerous songs from different artists that I want to combine into one album, so that when I browse using either Cover Flow or Album View, all those songs will be listed under one album. After over two hours of searching on the Internet I found

  • Rendering and exporting a QT File

    Does it take longer to export an unrendered sequence vs. a rendered sequence? My client wants his final product in a QT format, so, I thought to speed up the process i would skip the render.

  • ZDATASource  Activation error

    Hi Frnds, i am having one  ZData source activating issue in Development system.    Error is showing that "  Error  Message no. RSO410 could not be reset to the old active version. Since the generated objects no longer correspond to the old active ver