Queue Edit in Place Template FAQ

bulletWhat is the best embed point to use for implementing a lookup validation in a queue edit-in-place entry field?

The best embed point to use for edit-in-place validation is the Q Edit in Place "Take Action" embed before the parent call.  The validation code would look something like the following:

IF Self.COLUMN = 2 	!if Leaving Account number...
  CASE Action 		! check for action value...
    OF EditAction:Forward
  OROF EditAction:Backward
  OROF EditAction:Complete
  OROF EditAction:Next
  OROF EditAction:Previous	! if one of the above then validate account number
       AccountNbr = SELF.Eq.Control.Feq{PROP:Use} ! Move EIP field value into local var.
       IF NOT validAccount(AccountNbr)
          Action = EditAction:Ignore
       END
  END
END
END

bulletWhat do the "Hot" Fields entries do?

When you select the "Hot" Fields button, you can specify fields, not populated in the list, to be added to the SaveEntry GROUP created by the templates.  This SaveEntry GROUP is used to restore the queue entry to its original state if the user cancels the edit.  If you place any code in a Q Edit in Place embed that modifies queue fields not in the list box, then those fields should be added to the SaveEntry GROUP by using the "Hot" Fields button.

For example: We use queues much like regular data files; each queue "record" has a unique id that we use to link various queues together (like linking fields in a regular file relationship).  These id's are not displayed in the list box.  We might provide a drop down list via queue edit in place for the user to select some description from another queue, but we only want to store the linking id.  When the user makes their selection, we store the selected id into our queue via embedded code.  So far so good, however, if the user decides to cancel the edit we need to get the queue record back to its original state.  Since the id is not in the list box, it isn't accounted for in the basic template generated code, so we need to use the "Hot" Fields button to tell the template to manage the id field for us too.

bulletIs there a way to disable a column or field, depending on a special case?

The best embed point to use to disable edit-in-place for a particular column is the Q Edit in Place "GetEdit" embed before the parent call.  Your code would look something like the following:

IF Q.lColorNFG = COLOR:GRAY AND SELF.Column = 1    !if gray foreground and this is column 1
   RETURN(FALSE)                                   ! deny edit-in-place
END                                                !end if
END

bulletWhen using a spin control I want the up/down arrow keys to increment/decrement the control value, not move to the next/previous line; is there a way to do this?

The best embed point to use for this type of edit-in-place action is the Q Edit in Place "Take Action" embed before the parent call.  Your code would look something like the following:

IF Self.COLUMN = 2                    !if spin control...
    CASE Action                       ! check for action value...
    OF EditAction:Next                ! if down arrow key
        Q.f3 -= 1                     !   update he queue field
        DISPLAY(SELF.EQ.control.feq)  !   display result
        Action = EditAction:Ignore    !   ignore keystroke
    OF EditAction:Previous            ! if up arrow key
       Q.f3 += 1                      !   update the queue field
       DISPLAY(SELF.EQ.control.feq)   !   display result
       Action = EditAction:Ignore     !   ignore keystroke
    END                               ! end case
END                                   !end if