[progress Communities] [progress Openedge Abl] Forum Post: Re: Check Which Records Have...

  • Thread starter Thread starter egarcia
  • Start date Start date
Status
Not open for further replies.
E

egarcia

Guest
Hello, Yes, it is possible, however, we have not exposed this as an API in the JSDO. Perhaps, we could add method or properties in the future to tell whether a record has been modified or if it is new. You could try using the following approaches. However, please notice that since they use undocumented or internal functionality, the code may changed in the future if we optimize or improve the internal structures. 1) Use jsdo.ttperson.getChanges() (or jsdo.getChanges() if you are using a single table dataset). This function returns an array of objects with the record and a rowState property. This returns records for create, update and delete operations. (foreach() and getData() do not return deleted records.) This function is not documented and the structure that it returns may changed in the future. 2) Check that a record has been modified by checking if it has a before-image. You can use this approach in jsdo.ttperson.foreach(). (jsdo.eCustomer._beforeImage[customer.getId()] !== undefined) Note: The before-image for a new record is null. The before-image for an updated / deleted record is the original record. I hope this helps.

Continue reading...
 
Status
Not open for further replies.
Back
Top