I'm trying to use UpdatableRecord store() method, but it's not clear to me the right way.
In my scenario I would like
- create a record in memory, so
- store record wheter exists or not so )
rec=ctx.newRecord(MYTABLE)
rec.setField1(1)
rec.setField2(1)
....
rec.store()
Issue is store() try to always insert it (wheter exists or not on db) cause not loaded from db with rec.refresh(),
so that I've tried to do same thing using a refresh on rec (after set keys before set other values) but refresh()
fail is record doesn't exists. So:
- refresh() works only on existings records
- store() works only if a record is loaded from refresh() otherwise always insert
Am I right? Am I missunderstanding something?
How can I store a new record wheter exists or not on db?
Tks
Denis