Copying Marked records

SPost29SPost29 Member Posts: 148
I'm stumped!!
I want to mark records (or setselectionfilter) on a form then copy the marks or selection filter (and other filters) to another instance of the same table.
How can I do this?

Comments

  • garakgarak Member Posts: 3,263
    CurrForm.setselectionFilter(NewVariableOfTypeRecordBasedOnTheSameTable); <- this copies all blue (if no one is blue then the line where the courser is) makrd lines to the NewVariableOfTypeRecordBasedOnTheSameTable. (CurrForm.setselectionFilter(SalesHeader);)
    Now all blue marked recs are stored into the NewVariableOfTypeRecordBasedOnTheSameTable Recordinstance.


    If you mark the records in the listform (Ctrl+F1) you use the following:
    markedonly(true);
    if find('-') then begin
      repeat
        MyTempTABLEBasedOnTheSameTableLikeTheForm.init;
        MyTempTABLEBasedOnTheSameTableLikeTheForm := Rec;
        MyTempTABLEBasedOnTheSameTableLikeTheForm.insert;
      until next = 0;
    end;
    
    markedonly(false);
    

    Now all marked (Ctrl+F1) Recs are stored in the Temporary Table.

    regards
    Do you make it right, it works too!
  • SPost29SPost29 Member Posts: 148
    Thanks,
    Can I just copy the marks not the whole record?
    Like copyfilter except for marks.

    Steve
  • MBergerMBerger Member Posts: 413
    I think you just need top COPY your original record variable to the other instance NewInstance.Copy(OriginalInstance) ;
    COPY (Record)
    Use this function to copy a record from a C/SIDE table. All filters, marks, and keys are included in the copy.
    
    After that just remove the filters from the new instance.
Sign In or Register to comment.