Hi,
I have a formDataSource thats is a view. How can I create a RecordSortedList based on this fds?
I need to get the records selected in a form where the data source is my view. I dont need to pass the data that I included in that view using computed columns, the standard table is all I need.
private void buildInvoiceList() { list = new RecordSortedList(tableNum(CustInvoiceJour)); for (CustInvoiceJour = CustInvoiceJour_ds.getFirst(true) ? CustInvoiceJour_ds.getFirst(true) : CustInvoiceJour_ds.cursor(); CustInvoiceJour; CustInvoiceJour = CustInvoiceJour_ds.getNext()) { list.ins(CustInvoiceJour); } }
You indeed can't assign CustinvoiceJour to a variable for CustInvoiceJourView. These are two different things.
I have no idea why you're trying to get the number of selected records. If you believe that it's needed for MultiSelectionHelper, you're wrong.
Ah yes well the view is CustInvoiceJour Itself with additional computed fields so like CustInvoiceJourView.
I used this code before I made the change from table to view in my form because I needed more data on the form yet for the job I need only information stored in table CustinvoiceJour. The problem is invalid cast from CustinvoiceJour to CustInvoiceJourView when I change the table to view. Tried to overwrite it yet I had problem to get the count of selected items using recordsMarked() to loop through and since SysQuery::totalCount and totalNumberofRows is not what im looking for.
You showed some code, but forgot to mention what problem you have with it. Please add this information.
You mentioned a view, but CustInvoiceJour isn't a view. Doesn't it mean that your code uses a wrong data source?
By the way, I strongly recommend using MultiSelectionHelper to get selected records. It's easier to use, leaving less room for bugs.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156