Retrieval of Records on Find Browse Form

vaibhav

Member
Hi,
I have a find browse form that is working fine so far. however a new requirement needs the grid to show some records based on a new header field that is not a part of the business view. The value from the header field will go to couple of tables(F0413 and F0414) with many to many relationship of records and finally with have to fetch the data from the tables(F55XXX) in the business view and show them in the grid. I am taking the value from the header field something as shown below:
F04311.select (pass the header field value DOCM)
F04311.fetch next (will retrieve multiple records,PYIDs)
while file IO status is CO Success
F0414.select (based on many PYIDs retrieved frm F0413)
F0414.fetch next (will retrieve multiple DOCS)
while file IO status is CO Success
BC or ?? (of a custom table on which grid is based) = F0414.DOC
F0414.fetch next
End while
F0413.fetch next
End While.

The concern is where to write this code and to which parameter(FC,GC,BC) to pass in order to get the records in grid.
 
How about you make a workfile, base the Find Browse on a view on this table. Then, on the Find button - Button Clicked event, you populate this workfile with the records & data you want to show in the grid using the logic you describe in your post. The form will then automatically display these records in the grid.
 
Thanks Remo for your reply !!

I have considered that one as the last workaround, however before that I wanted to check if there is any functionality available which I might be missing. Your solution is indeed a nice one and thanks again. I will post once I am through with it.
smile.gif
 
I have written the below code on 'Find' button which works just for single records not in while loop , any idea.
----------------------------------------------------------
Set Selection Append Flag(FC Grid, <Yes>)
F0413.Select
FC Payment/Item Number. = TK Document - Matching(Payment or Item)
F0413.Fetch Next
VA grd_PaymentID <- TK Payment ID (Internal)
While SV File_IO_Status is not equal to CO ERROR
F0414.Select
VA grd_PaymentID = TK Payment ID (Internal)
F0414.Fetch Next
VA grd_CompanyKey <- TK Document Company
VA grd_DocumentType <- TK Document Type
VA grd_DocVoucherInvoiceE <- TK Document (Voucher, Invoice, etc.)
While SV File_IO_Status is not equal to CO ERROR

Set Selection Group(FC Grid, F55XXXX, "DOC", <Equal To>, VA grd_DocVoucherInvoiceE, <And>)
Set Selection Group(FC Grid, F55XXXX, "DCT", <Equal To>, VA grd_DocumentType, <And>)
Set Selection Group(FC Grid, F55XXXX, "KCO", <Equal To>, VA grd_CompanyKey, <And>)

F0414.Fetch Next
VA grd_CompanyKey <- TK Document Company
VA grd_DocumentType <- TK Document Type
VA grd_DocVoucherInvoiceE <- TK Document (Voucher, Invoice, etc.)

End While

F0413.Fetch Next
VA grd_PaymentID <- TK Payment ID (Internal)
End While
 
No what I meant was, in the FindButton-ButtonClicked event, you use the logic you mention to retrieve all the data you want to display in your grid. But you don't display it yet. Instead, you write the records to a workfile. And because you use a view over that workfile, the engine (or whatever you call it) will then automatically read the records from your workfile and display them in the grid.
 
Hi, You can use the below code

Button Clicked (Find Button)
// Call the Push Button
Press Button (Custom Push Button)

Button Clicked Event (Custom Push Button)
//
F0413.Select
FC Payment/Item Number. = TK Document - Matching(Payment or Item)
F0413.Fetch Next
VA grd_PaymentID <- TK Payment ID (Internal)
//
While SV File_IO_Status is not equal to CO ERROR
F0414.Select
VA grd_PaymentID = TK Payment ID (Internal)
F0414.Fetch Next
VA grd_CompanyKey <- TK Document Company
VA grd_DocumentType <- TK Document Type
VA grd_DocVoucherInvoiceE <- TK Document (Voucher, Invoice, etc.)
While SV File_IO_Status is not equal to CO ERROR
//
// Insert the records into Workfile //
F55Workfile
VA grd_CompanyKey -> TK Document Company
VA grd_DocumentType -> TK Document Type
VA grd_DocVoucherInvoiceE -> TK Document (Voucher, Invoice, etc.)
VA grd_UserID -> TK User
VA grd_ProgramID -> TK Program ID
VA grd_Time -> Time last Updated
VA grd_Date -> Date Updated

//
F0414.Fetch Next
VA grd_CompanyKey <- TK Document Company
VA grd_DocumentType <- TK Document Type
VA grd_DocVoucherInvoiceE <- TK Document (Voucher, Invoice, etc.)
//
End While
//
F0413.Fetch Next
VA grd_PaymentID <- TK Payment ID (Internal)
End While


Grid Records is Fetched Event
// Compare the datafro F55XXXX with Workfile (F55Workfile)
BC Document Company = TK Document Company
BC Document Type = TK Document Type
BC Document (Voucher, Invoice, etc.) TK Document (Voucher, Invoice, etc.)
If SV_FILE IO status is not equal CO Success
Suppress grid line (FC Grid)
End if


Post Button Clicked (Find Button)
// Delete the Worfile records
VA_User = TK User
VA_Time = TK Time
VA_Date = TK Date



T,
Reddy
JD Edwards E9 consultant
OnewoRLD xe, 8.12, e9
 
Back
Top