SETSELECTIONFILTER + Ctrl-A

rikus12rikus12 Member Posts: 8
I have a problem using the CurrForm.SETSELECTIONFILTER -functionality.
I open a form for example the Customer List, and when a press Ctrl-A (default windows-functionality to select all) and I then perform an action using de CurrForm.SETSELECTIONFILTER, no records are marked.
When I select the records by clicking the mouse in the first record and scrolling down to the last, it works fine.
Is there a solution how I can make Ctrl+A work too?

Comments

  • ara3nara3n Member Posts: 9,256
    Hello
    Add a menu Item in a menu button and set the shortcut to Ctrl+a. Then on push add your code to mark the current records. This is the only way I see you could do it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SPost29SPost29 Member Posts: 148
    From the CSide Help
    SETSELECTIONFILTER (Form)
    Use this function to have the system note the records the user has selected on the form, mark those records in the table specified, and set the filter to "marked only".

    CurrForm.SETSELECTIONFILTER(Record)
    Record

    Data type: record

    A specific record or records.

    Comments
    If either all or no records are selected, marks will not be used.


    Steve
  • pdjpdj Member Posts: 643
    rikus12 wrote:
    Is there a solution how I can make Ctrl+A work too?
    Just to clarify. Ctrl-A and SETSELECTIONFILTER works fine - it is your code that incorrectly assumes that something is marked.
    The proper way to use SETSELECTIONFILTER is almost always like this:
    ...OnPush()
    CurrForm.SETSELECTIONFILTER(LocalRec); // Never never use Rec !!!
    IF LocalRec.FIND('-) THEN // Or FINDSET if available
      REPEAT
        DoWhatEver(LocalRec);
      UNTIL LocalRec.NEXT = 0;
    
    Could it be any easier? 8)
    Regards
    Peter
Sign In or Register to comment.