home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,426 of 9,834   
   Kenneth to liz@paradoxcommunity.com   
   Re: Unlocking problem...   
   06 Apr 07 09:39:14   
   
   From: usenet@soleSPAMLESSassociates.com   
      
   On Wed, 04 Apr 2007 11:05:39 -0600, Liz McGuire   
    wrote:   
      
   >Try this:   
   >   
   >1. Put the stuff in the action event in a switch - only one action   
   >happens at a time, but if you use if blocks, they are all checked - use   
   >a switch.   
   >   
   >2. In the second bunch, do this   
   >   
   >case eventInfo.id() = DataArriveRecord :   
   >   if not isEdit() then   
   >     edit()   
   >   endIf   
   >   doDefault  ;// **   
   >   ViewedOn.value = today()   
   >   ViewedOn.unlockRecord() ;// ***   
   >   
   >   
   >** I rarely recommend this, but it seems the best option in this   
   >situation.  This may well fix the problem entirely - you're probably   
   >trying to write to the field before the arrive is complete enough to   
   >allow it and it's probably another record that's already locked...   
   >   
   >*** Unless the ViewedOn field is part of the current index and/or   
   >there's a validity check that hasn't been met, this should be fine.  If   
   >it's part of the current index, try dropping this line and see what   
   >happens.  If there are validity checks which might not have been met   
   >yet, then you'll have to decide what to do - try without this line, put   
   >it in a try block and in the onFail you can either do errorClear() (the   
   >record stays locked) or something else (post, pop an error, cancel your   
   >edit, whatever - it depends on your needs).   
   >   
   >Liz   
      
   Hi Liz,   
      
   As always, I very much appreciate your suggestions, but I am   
   confused about how to proceed...   
      
   First, no, the Viewed field (I changed its name) is not part   
   of any index.   
      
   Next, on the form's action method, I now have:   
      
   method action(var eventInfo ActionEvent)   
      
   var   
   endVar   
   	if eventInfo.isPreFilter() then   
   		;// This code executes for each object on the form:   
    if isEdit() then   
   	if eventInfo.id() = DataRefresh then   
   	  eventInfo.setErrorCode(UserError)   
   	endIf   
    endIf   
   	else   
   		;//This code executes only for the form:   
      
   if  (eventInfo.id() = DataPostRecord   
     and  active.RecordStatus("New"))   
   or  (eventInfo.id() = DataUnlockRecord   
     and (active.RecordStatus("Modified")   
   or   active.RecordStatus("Locked"))) then	   
   	ModDate.value = today()   
   endIf   
      
   if eventInfo.id() = DataArriveRecord then   
   	Viewed.postAction(userAction + 123)   
   endIf   
   endIf   
   endMethod   
      
      
   and on the action event of the field "Viewed" I now have:   
      
   method action(var eventInfo ActionEvent)   
      
   if eventInfo.id() = userAction + 123 then   
   	Viewed.value = today()   
   endif   
      
   endMethod   
      
      
   I have read your comments with care, but don't understand   
   what it is you are suggesting I modify.   
      
   Thanks for any further help...   
      
   All the best,   
   --   
   Kenneth   
      
   If you email... Please remove the "SPAMLESS."   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca