Form, 'In Scope'

I am working on adding a function to the Sales Invoice Form. It will be an export Dataport that will process Sales Invoice Line’s and write records to an extract file. When the function executes, it should only process those Sales Lines that are ‘in scope’, meaning the lines currently on display on the form. Based on other logic I’ve researched, I tried using SETFILTERGROUP := 2, but this isn’t working. What is the most efficient way to do this?

…just DATAPORT.RUNMODAL(Rec) will do the job. All filters on Rec will be considered. If you want to just treat the records marked by Ctrl+F1 or Windows marked (dark blue in standard Windows setup), used CurrForm.SETSELECTIONFILTER(Record). It’s always good to copy the Rec to a new variable with Rec2.COPY(Rec) and run the dataport on this one, just in case you modify the filters on the record the display in the form will stay the same this way.

Beaver, Thanks, this worked great!