DataSet Vs Obj Methods

Hi,

What is the best option to perform the Save, update delete, and browse operation on data type? In my case, I have to deal with a bulk amount of data. I want to understand which of these two options will be the best fit.

Thanks,

@AAV7601 Hi there,

I´m assuming you´re not dealing with datasets, but are simply looking at how to handle database operations for concrete instances (data types add the element of persistance to data classes). In that case, what we usually do is:

  1. For browsing data, do an Obj-Browse (up to 10.000 records) or retrieve data from a report definition (Call pxRetrieveReportData from an activity). Reports can be easier, especially if you’re retrieving data from multiple classes. They also allow you to view the results before running the activity if that is desired.
  2. For updating data, loop over the results from the browse and do, for example, a Property-Set to update a field. Do an Obj-Open-By-Handle prior to this, and save and commit the changes after the Property-Set if no errors are present. (Use commitWithErrorHandling in most situations)
  3. For deleting data, you do not need to open the object first. You can use Obj-Delete-By-Handle directly.

Now, if you have a larger dataset, there are plenty of options too. You can recursively call the activity again if there are more results, and let a queue processor handle the other database operations asynchronously. Or if you want to schedule it, use a job processor to run the activity every x minutes.

@BasG0629 Thank you so much,

yes, I have created the data set rule and was trying with both the options Data set and Obj methods. So I think from this Obj methods are the best way to go.

@AAV7601 Glad to help, let me know how it goes!

@AAV7601 As mentioned by Bas, for 10,000 kind of records you can use obj methods or Report Definition. But for larger data like 1 Lakhs or 10 Lakhs or more than that you will have to use data-set. Data set processing way too faster and efficient for larger data volume.

@AnoopK12 That is true

Thanks for your valuable input