Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S question about new values in updateRecord

 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume, in updateRecord(long recNo, String[] data, long lockCookie),
String [] data contains only new values and no old values.
am I correct?

ex: If I want to update name of recNo 1, then in String[] data,
the data structure should be like data[0]="new name", data[1]="", data[2]="", data[3]=""
........am I right??

 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,

Good question.

I do not think you should use "" as an indication that a field should not be updated. What would happen if you wanted to intentionally delete a field?

This is how I have handled it so far:

This allows me to update a record in one of two ways:
1. String[] newData = {"new name", "old location", ..., "old owner"};
OR
2. String[] newData = {"new name", null, null, null, null, null};

And as always, it will be well documented.
 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply.
Greate solution.
I redesigned and changed my code according to your suggestion.
Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic