I'm trying to create a popup menu from my xBrowse that builds a list based on an open database, i then want to pass a field from that database to the action.
First i build an array of records from the database, and then i add menuitems to the menu. The list of items appear correctly, however, when i click on the item i get a bound error. Can anyone tell me where i'm going wrong?
- Code: Select all Expand view
METHOD SchedPopup() CLASS Schedule
Local oMenu
LOCAL nCount := 0
LOCAL aVehicles := {}
PRIVATE cSced := ::cScedAlias
PRIVATE cVehc := ::cVehcAlias
PRIVATE cFunc := "::UpdateVehc("
IF !::lVehicle
&cVehc.->(DBGOTOP())
DO WHILE !&cVehc.->(EOF())
Aadd(aVehicles, &cVehc.->VEHCL_NBR)
&cVehc.->(DBSKIP())
ENDDO
ENDIF
MENU oMenu POPUP // Creating a POPUP
MENUITEM "Edit Ticket" ACTION ::AmendTicket()
MENUITEM "View Ticket" ACTION ::ViewTicket()
MENUITEM "Confirm Ticket" ACTION ::Confirm()
MENUITEM "Print Ticket" ACTION ::PrintTicket()
MENUITEM "Allocate Ticket" ACTION ::Allocate()
MENUITEM "Allocate To..." ACTION .T.
MENU
FOR nCount := 1 TO Len(aVehicles)
MENUITEM aVehicles[nCount] ACTION ::UpdateVehc(aVehicles[nCount])
NEXT
ENDMENU
MENUITEM "DeAllocate Ticket" ACTION ::Dealloc()
MENUITEM "Edit/View Transaction Notes" ACTION ::TicketNotes()
MENUITEM "Edit/View Container Info" ACTION ::ContainerInfo()
MENUITEM "Edit/View Additional Items" ACTION ::OrdItems()
IF !Empty(&cSced.->OR_VEHICLE)
SEPARATOR
MENUITEM "Open Schedule For Highlighted Vehicle" ACTION ::VehicleSchedule()
MENUITEM "Open Vehicle Diary" ACTION ::VehicleDiary()
ENDIF
SEPARATOR
MENUITEM "Move To New Site" ACTION ::MoveSite()
MENUITEM "Move To New Date" ACTION ::MoveDate()
MENUITEM "Move To New Schedule" ACTION ::ChangeScedType()
SEPARATOR
MENUITEM "Send SMS To Customer" ACTION SMSMessage(GetCustMobileNo(::cScedAlias), "")
MENUITEM "Send SMS To Site Address" ACTION SMSMessage( "", GetSiteMobileNo(::cOrdAlias))
ENDMENU
return oMenu
Thanks in advance,
Pete