Server Module erroring using Select with option(*STARTKEY *BACKWARDS)
Posted: Tue Mar 26, 2019 11:10 am
I'm wanting to get a list of records in descending date order from a logical called ITMBYDTE.
Keys
CONO15 ASCEND
CUSN15 ASCEND
DOCD15 ASCEND
ETYP15 ASCEND
LREF15 ASCEND
Srvroutine Name(GetARTransactionList)
Field_Map For(*INPUT) Field(#CONO15) Parameter_Name(Company)
Field_Map For(*INPUT) Field(#CUSN15) Parameter_Name(Dealer)
List_Map For(*OUTPUT) List(#ARTRansactionsList)
* Get all records from the file using some or all of the key
Select Fields(#SLP15) From_File(ITMBYDTE) Where((#ETYP15 <> 'UC') *And (#ETYP15 <> 'JL') *And (#LREF15.Substring( 1 1 ) <> 'W')) With_Key(#CONO15 #CUSN15 9999999) Generic(*YES) Io_Status(#Io$sts) Io_Error(*NEXT) Issue_Msg(*YES) Options(*STARTKEY *BACKWARDS)
Add_Entry To_List(#ARTRansactionsList)
Endselect
Endroutine
I'm selecting customer code 'PBENDI01' from the webpage but the code keeps reading past 'PBENDI01' reading other dealers then fails back in the View:
Evtroutine Handling(#GetList.Failed) Handled(#handled)
#handled := true
#sys_web.console.log( ('load Of AR Transaction List failed') )
Endroutine
What do I need to do to get this working please?
Keys
CONO15 ASCEND
CUSN15 ASCEND
DOCD15 ASCEND
ETYP15 ASCEND
LREF15 ASCEND
Srvroutine Name(GetARTransactionList)
Field_Map For(*INPUT) Field(#CONO15) Parameter_Name(Company)
Field_Map For(*INPUT) Field(#CUSN15) Parameter_Name(Dealer)
List_Map For(*OUTPUT) List(#ARTRansactionsList)
* Get all records from the file using some or all of the key
Select Fields(#SLP15) From_File(ITMBYDTE) Where((#ETYP15 <> 'UC') *And (#ETYP15 <> 'JL') *And (#LREF15.Substring( 1 1 ) <> 'W')) With_Key(#CONO15 #CUSN15 9999999) Generic(*YES) Io_Status(#Io$sts) Io_Error(*NEXT) Issue_Msg(*YES) Options(*STARTKEY *BACKWARDS)
Add_Entry To_List(#ARTRansactionsList)
Endselect
Endroutine
I'm selecting customer code 'PBENDI01' from the webpage but the code keeps reading past 'PBENDI01' reading other dealers then fails back in the View:
Evtroutine Handling(#GetList.Failed) Handled(#handled)
#handled := true
#sys_web.console.log( ('load Of AR Transaction List failed') )
Endroutine
What do I need to do to get this working please?