Alpha Video Training
Results 1 to 3 of 3

Thread: Event behavior

  1. #1
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Event behavior

    Hi,

    I have this script on OnWroteField and OnChangeRecord Events.
    Code:
    dim tbl as p
    dim vOdrQty as n = 0
    dim vCheck as l = .f.
    	tbl = table.get("Po_RcvItm")
    	vCheck =tbl.CHECK_ALL
    	vOdrQty = tbl.ODRBALANCE_QTY
    	
    	if vCheck = .t. then
    	  tbl.RECEIVED_QTY = vOdrQty
    	else 
    	   vOdrQty = 0
    	   tbl.RECEIVED_QTY = vOdrQty
    	end if
    I tested on the Default Form, It worked fine whenever I changed to "T or F" , the field value changed.
    However, I tried on the form, did not work.

    Did I use it on wrong events or this scenario is not working with Table Level events?

  2. #2
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Event behavior

    Try:
    Code:
    dim tbl as p
    dim vOdrQty as n = 0
    dim vCheck as l = .f.
    	tbl = table.current()
    	vCheck =tbl.CHECK_ALL
    	vOdrQty = tbl.ODRBALANCE_QTY
    	
    	if vCheck = .t. then
    	  tbl.RECEIVED_QTY = vOdrQty
    	else 
    	   tbl.RECEIVED_QTY =0
    	end if
    topparent.resynch()

  3. #3
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: Event behavior

    John,

    1) I suggest you not use the OnChangeRecord record event for this. Check the help file docs. This event does NOT occur when values in the record change.

    2) What's the name of the table your field rule script is for? Are you trying to set a field value in the same table for which you are defining rules? Or, are you trying to set a field value in a different table?

Similar Threads

  1. Field Event - Record Event not firing
    By David Boomer in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 06-08-2009, 08:57 PM
  2. How do I find the Error in event handler code for OnClick event
    By Easy Rider in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 08-21-2008, 11:09 PM
  3. Error in event handler code for online click event...
    By Steve Wood in forum Application Server Version 8
    Replies: 1
    Last Post: 12-15-2007, 12:28 AM
  4. Trigger another Event from an event
    By Ericl in forum Alpha Five Version 7
    Replies: 4
    Last Post: 04-07-2006, 02:28 PM
  5. OnTimer event wierd behavior
    By Robert Emery in forum Alpha Five Version 4
    Replies: 2
    Last Post: 10-24-2001, 06:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •