Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

     Evtroutine Handling(#DELETE.Click)
     Use Builtin(MESSAGE_BOX_SHOW) With_Args(YESNOCANCEL NO QUESTION 'Confirm Delete' 'Are you sure you want to delete?') To_Get(#answer)
     If Cond(#answer = YES)
     Delete From_File(xDepartments) With_Key(#xDepartmentCode) Val_Error(*NEXT)
     Case Of_Field(#IO$STS)
     When Value_Is(= OK)
     Message Msgtxt('Department deleted successfully')
     #formdata := *default
     When (= NR)
     Message Msgtxt('Department not found')
     When (= ER)
     Message Msgtxt('Error deleting department')
     Endcase
     Endif
     Endroutine
  

Note
Note: You should review the documentation for the MESSAGE_BOX_SHOW Built in Function in the Technical Reference Guide. It can also be used with MESSAGE_BOX_ADD,  MESSAGE_BOX_APPEND and MESSAGE_BOX_CLEAR Built in Functions to output a message box containing more text.

...