|Subject:||Re: Record Unlocking
|Date:||Fri, 22 Jun 2018 07:58:21 -0500
|From:||Mark Bannister <markRemove@THISinjection-moldings.com>
Currrecord() can cause data loss if there is really and uposted record.
On 6/21/2018 8:30 PM, Peter wrote:
> Hmm, been doing some thinking and observing since I posted this question.
> It seems that the problem is only the last defined field that has been
> changed and focus remains on the field, ie not departing.
> The button I click has TabStop property set to False so focus would not
> leave the field and therefore the record would be locked by Pdox? But
> the status bar does not have a "Locked" mssg.
> So if that were the case maybe all I have to do is find out which field
> has focus and issue an unlockRecord()?
> Well that didn't work either
> I used a tc.currRecord()and that seems to have solved the problem so far.
> I have no idea why the table and the tcursor cannot sync up with resync,
> nor why the tcursor is not up to date when I issue an unlock.
> On 06/21/2018 12:50 PM, Peter wrote:
>> I have been fighting a stubborn issue of not being able to post/unlock
>> a record. Finally found the problem and have been able to make a fix
>> but it is clumsy and I hope someone can provide an alternative.
>> I have a form and several tables in the datamodel. The one table (call
>> it tableA) at issue is not linked.
>> Several fields on the form are defined from tableA
>> I use a tc.dmAttach("TableA") to make changes to records as well as
>> unlocking. The problem I ran into is that after unlocking the data
>> would not post to the table.
>> I tried TableA.dmResync(tc) - did not solve the problem
>> I tried dmResync(TableA,tc) - did not solve the problem
>> I tried field.unlockRecord (using one of the defined fields)and that
>> worked when that field had been changed.
>> I then tried field.unlockRecord() for all defined fields and that
>> worked, as such:
>> What seems to happen is that if a defined field's value has been
>> changed then it needs a distinct unlock/post record
>> So, is there a way to unlock all the define fields of a single table
>> (in the datamodel) in one statement instead of independantly?
>> ps I also put a self.unLockRecord() in the :depart: method of each
>> defined field and that worked also, again clumsy I think.