Insert data to record sorted list

Hi,

I’m facing a problem while inserting data into RecordSortedList. I have program which find the sales orders based on serial number. If the sales order is found, sales order details is inserted into RecordSortedList. Issue is, while inserting data into RecordSortedList, Ax throws error that ‘RecordSortedList’ insert should be called from server. Is any other way possible to insert data into RecordSortedList without running it on the server mode ?

Regards,

Raghav.

That’s by design (and documented [:)]). The logic you describe (… find the sales orders based on serial number …) should completely run on server - why would get all data to client and send them back? Move the whole thing to server and you will not only resolve the problem with RecordSortedList, but also get better performance and lower network traffic.

Hi Martin,

Insertion to RecordSortedList works fine if it is run under server mode. The input i.e., serial number is from a CSV file. When the class is run under server mode, Ax is unable to initialize CommaIO class. Hence the file is not read. How to read the file when the class is being run under server mode.

Regards,

Raghav.

  1. CommaIo does work on AOS. Your problem is somewhere else - usually with permissions, or the path is not valid on AOS.
  2. By the way, CommaIo class is deprecated, you should use CommaTextIo.
  3. If your file exists on client only, AOS can’t read it, therefore you have to do it on client. But that’s not in conflict with what I wrote before - what you should do is to collect user input (even as a file) on client, send it to server and run the DB-intensive processing there.

Hi Martin,

I’m CommaTextIo to read CSV file. You are correct. I read the file (initialize CommaTextIo) on client side and sent the fiel to the server. It works fine.

Regards,

Raghav.