Announcement

Collapse
No announcement yet.

Changing Cursor Placement on Sequenced Records > 1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing Cursor Placement on Sequenced Records > 1

    Changing Cursor Placement on Sequenced Records > 1
    When working with sequenced records in data entry, it is often the case that the first sequence may require some initial information that is later carried to the subsequent sequenced records. The problem is that you can only specify the initial cursor placement in the screen properties editor.

    Using the onLoad method, we can conditionally specify or change where the cursor should go based on the current sequence value.
    • Set initial cursor field in the screen properties to have a default for the first sequence. This may be something like visit date.
    • In the onLoad method use the sequence object to see if the current sequence is > 1.
    • If it is > 1 then use the desired fields _goto() method to send the cursor there. In this case it is the height field.

    Note: To keep the cursor from going back up to the fields entered on the first sequence, just use the NextField property on the last field to go back to the desired spot. In this case, the height field.

    Code:
    /** onLoad Method **/
    
    %include objfile;
    
    _onLoad: method _self_:u:object;
    link createobj;
    ************************;
    ** Add user code here **;
    ************************;
    
    if sequence.text > 1 then height._goto();
    
    
    endmethod;
Working...
X