Alpha Video Training
Results 1 to 22 of 22

Thread: Selected rows

  1. #1
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Selected rows

    Selected Records
    In an emb browse I select 4 consecutive rows then run an update operation (Menu, Records/Update). A5 updates all the records in the emb browse (31 records). For me "selected" means the highlighted rows, for A5 it means all child records. How can I get A5 to update the 4 highlighted rows only, not all childs records?

  2. #2
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    I don't know a way of doing this. One work around is to use xbasic and the browses doubleclick, but that would not be as intuitive (nor as easy) as highlighting the records.

  3. #3
    VAR
    Real Name
    John Lemisch
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    673

    Default Re: Selected rows

    first mark (ctrl-m) the highlighted records, then run your update on marked()

  4. #4
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by John Lemisch View Post
    first mark (ctrl-m) the highlighted records, then run your update on marked()

    Except in a network - unless you like to take risks.

  5. #5
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Selected rows

    What do you mean by "run an update operation"? What does it do?
    current_highlighted_records() should do the trick for you.

  6. #6
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by G Gabriel View Post
    current_highlighted_records() should do the trick for you.
    Another way cool secret alpha function! Except I can't get it to work (using a5 sports and the example script in the help) :
    Code:
    filter = current_highlighted_records()
    order = "lastname"
    report.preview("customer list", filter, order)
    I get a blank report page.

  7. #7
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Selected rows

    Make sure the report does not have a base filter.

  8. #8
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: Selected rows

    John Lemisch
    first mark (ctrl-m) the highlighted records, then run your update on marked()
    Yes this works, but

    Peter.Greulich
    Except in a network - unless you like to take risks.
    Do you mean that this will not work/will have problem if the app is on a network?

    G Gabriel:
    What do you mean by "run an update operation"? What does it do?
    I highlight 4 rows then from the Menu choose Records --> Update, then select the field then enter a value say "JL958". What I am aiming at is have A5 insert the value only in the 4 highlighted records in the chosen field.

  9. #9
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by G Gabriel View Post
    Make sure the report does not have a base filter.
    There's no base filter in the Customer_List report in A5 Sports. Just doesn't seem to work.

  10. #10
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by gaby_h View Post
    Do you mean that this will not work/will have problem if the app is on a network?
    If 2 or more users are marking records at the same time, each user will get ALL the marked records, not merely the ones they selected.

  11. #11
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: Selected rows

    Quote Originally Posted by Peter.Greulich View Post
    If 2 or more users are marking records at the same time, each user will get ALL the marked records, not merely the ones they selected.
    Glad you pointed his out; thank you.

  12. #12
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows


  13. #13
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Selected rows

    Peter,
    Over a network why couldn't the following be used--I tested it a while ago and sure seemed to prevent a shadowed user from accessing a specific form called "Report_Menu" when it was already being used...That way if someone is marking records, use of the same table could conceivably be prevented. What have I missed???? Must have missed something I would think as I have not seen this used yet. This is placed on the CanArrive event of the button that calls the Report_Menu form.

    Code:
    dim msg as c
    if is_object("Report_Menu")
        cancel()
       msg="The Report Menu has already been opened by "+gvUser
        msg=msg+" on the computer called "+gvMach+".  Only one user at a time can use the report filters."
         msg=msg+"  Please try again later."
        ui_msg_box("Attention",msg)
        end
    end if
    EDIT: also I have tried to use the current_highlighted_records() function to no avail--did not say anything as was just messing around with it then.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  14. #14
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,307

    Default Re: Selected rows

    Mike, each instance of Alpha Five running against the database runs in its own space. You can't use is_object("form_name") to determine if other workstations have the form open. Each instance of alpha Five runs in its own space, oblivious to the fact that other workstations may also be running the same form in Alpha Five.

    -- tom

  15. #15
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by MikeC View Post
    Peter,
    Over a network why couldn't the following be used--
    Mike,

    is_object() is only valid in the current Alpha session, just like a variable. It can't see objects across a network.

    The other problem is that the marked records will be seen by all users, so it will be a source of confusion if user A marks records 1,2 & 3, and user B marks records 13,14 & 21. Both A & B will see all 6 marked records at the same time. Doesn't make sense.

  16. #16
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Selected rows

    Tom, Peter,
    What you both said, of course, makes sense.....but will test again as I seem to remember this preventing me from accessing the form when the "server" computer had the form already opened, thus preventing the problem.

    But obviously I could have been mistaken considering both of you say that it cannot work!!! :D

    I will post back after retesting in a day or so (most likely to prove you both right!).
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  17. #17
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Selected rows

    Hi all,
    I don't know why it works but it does (I obviously could not leave this testing until later!! :) ).

    This application was built in version 5 if that makes any difference at all.
    I have two computers networked. One has the full development copy of Alpha and runs the application. The other just uses the runtime and opens up the application across the network. I tested with and without shadowing. If the form in question is open on either of the two computers, it prevents the other from opening up the same form.

    What am I possibly doing different from other network scenarios that allows this to work when apparently it is not supposed to??
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  18. #18
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Selected rows

    Hold on!!! I inadvertantly gave the incorrect script for the OnArrive event of the button...

    This is what is actually placed as the former did NOT work!

    Code:
    dim t as p
    t=table.current()
    status=t.is_record_locked()
    
    if status
      cancel
      ui_msg_box("Attention!", "The Report Filters have already been opened by another user.  Try again later.")
      end
    end if
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  19. #19
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by MikeC View Post
    t=table.current()
    status=t.is_record_locked()
    ...
    Mike, needless to say, if you first put a particular record into change mode and then test against that particular record, you can do what you say, but...seems like a really strange way to accomplish what you are after. If for some reason I wanted to do what you are doing, I probably would use a special table and set the value there to check against...but that's just me.

  20. #20
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Selected rows

    Peter,
    The reason behind my creating this code was so that when networked, two (or more) users could not be choosing report filters/criteria at the same time...analogous to what this thread mentions in using the mark records and the problems that would ensue when more than one user could mark records.

    My question(s)...and apologies to Gaby if this is not something that is applicable to the original question:

    What, if anything, is inherently "wrong" (or what is strange about it!) with this VERY simple method that sure seems to work for the purpose I describe? And how would your method work easier or be more foolproof?

    As I came up with this on only my second attempt at trapping this situation I am by no means wedded to it.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  21. #21
    Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,639

    Default Re: Selected rows

    Quote Originally Posted by MikeC View Post
    Peter,
    The reason behind my creating this code was so that when networked, two (or more) users could not be choosing report filters/criteria at the same time...analogous to what this thread mentions in using the mark records and the problems that would ensue when more than one user could mark records.

    My question(s)...and apologies to Gaby if this is not something that is applicable to the original question:

    What, if anything, is inherently "wrong" (or what is strange about it!) with this VERY simple method that sure seems to work for the purpose I describe? And how would your method work easier or be more foolproof?

    As I came up with this on only my second attempt at trapping this situation I am by no means wedded to it.
    Sorry, Mike. I didn't mean to be critical. I guess I fail to see how this works in the way that you suggest. Perhaps you could explain the steps on how you implement this. Thanks.

  22. #22
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: Selected rows

    Finally... figured it out:
    I was running in circles trying to do it with operations.... the solution is simpler.
    In Action Scripting, category: Records, --> Mark Record, choose the level (Browse1 in my case).
    That's it. To use it: in the emb browse, highlight the rows push the button and the records are marked.
    I need to get some sleep now.

Similar Threads

  1. rows and column
    By chunyang in forum Alpha Five Version 7
    Replies: 1
    Last Post: 05-05-2006, 05:51 AM
  2. Repeating rows - why?
    By Peter.Greulich in forum Web Application Server v7
    Replies: 6
    Last Post: 12-29-2005, 08:55 AM
  3. ROWS
    By Joe De Rocker in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-07-2004, 05:41 AM
  4. blank rows
    By Sarah Mengesha in forum Alpha Five Version 5
    Replies: 3
    Last Post: 05-05-2004, 02:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •