Have Lines selected with code

DynamicsSolDynamicsSol Member Posts: 24
Hi there,

Is there a way to have lines selected with code?? So instead of pressing the left Bar list ( that makes the whole line go blue)of a listform you could use a button which will select the line(s) and then based on setselectionfilter have those records run through a code..

I can not find anything that emulates the pressing of the left Bar , even tried the sendkey commands.

Thanks

Comments

  • rjmvdvenrjmvdven Member Posts: 22
    Hi there,

    Is there a way to have lines selected with code?? So instead of pressing the left Bar list ( that makes the whole line go blue)of a listform you could use a button which will select the line(s) and then based on setselectionfilter have those records run through a code..

    I can not find anything that emulates the pressing of the left Bar , even tried the sendkey commands.

    Thanks

    You can also use the MARK function. So when you press a button set the MARK. Then when you use a function, use the function MARKEDONLY, so it will set a filter on all the lines that are marked. And you can do whatever you want with the lines.
    Best Regards,

    Remco van de Ven
  • DynamicsSolDynamicsSol Member Posts: 24
    edited 2014-01-05
    Hi there,

    SELECT: Wondering if it is also possible to select multiple lines this way ???

    Using MARK: well can not seems to get that to work, since the lines which are needed to be selected are in a subform and all the form needs to be operated as a touchscreen. I tried something like:


    currform.<subform>,getrecord<varrecord> ;
    Varrecord.mark;

    to have the lines marked, but when I press a button to goto different line in the form the mark is gone, probably cause the subform is using a different instance of table or something.. HOw to get the marking stick when using a subform in a touchscreen environment..
  • DynamicsSolDynamicsSol Member Posts: 24
    UpdateL

    I created a function in the subform:
    Par: SalesLines2:record "Sales line"

    Rec:=SalesLines2;
    MARK(true);
    Currform.update(false);

    I call this function from the Main form and the mark is set on that record, but when I excecute the function( touchscreen) also from the main form to goto a different record then the mark seems to be gone ...

    Besides a MARK(false) what else can trigger Nav to unmark a record???
  • william_marcelinuswilliam_marcelinus Member Posts: 34
    UpdateL

    I created a function in the subform:
    Par: SalesLines2:record "Sales line"

    Rec:=SalesLines2;
    MARK(true);
    Currform.update(false);

    I call this function from the Main form and the mark is set on that record, but when I excecute the function( touchscreen) also from the main form to goto a different record then the mark seems to be gone ...

    Besides a MARK(false) what else can trigger Nav to unmark a record???

    have you set MARKEDONLY(TRUE) after using MARK(TRUE) ?
    i think you don't need Update(false), because dynamics already auto-refresh page / form when filter such as MARK triggered
    hope it works.
Sign In or Register to comment.