How to set data filter for a subpage view?i

Hi Expert.

I got a pb, I created a page ,with integer source table and a subpage part? but I created a record variable and wrote codes on openpage view trigger, but it doesn't work.

i tried the steps below:

1, I created a function in a subpage(purchase order subform), and wrote such function on purchase suborder form:

SetDataFilter(VendorNo : Code[20];StartDate : Date;EndDate : Date)
SETFILTER("Buy-from Vendor No.",VendorNo);
SETFILTER("Document Date",'%1..%2',StartDate,EndDate);
CurrPage.UPDATE(TRUE);

2. Icreated a global function on page (vendor state page).

SetVendorFilter(VendorNo : Code[20];VendorName : Text[100];StartDate : Date;EndDate : Date;AccountNo : Code[1024])
v_poc := VendorNo;
v_zdmc := VendorName;
v_date_b := StartDate;
v_date_d := EndDate;
V_AccNo := AccountNo;
CurrPage.Purchase_Lines.PAGE.SetDataFilter(VendorNo,StartDate,EndDate);
CurrPage.UPDATE(TRUE);

3. I created a process-only report

and filled some varaible on the request page.

Integer - OnPreDataItem()
Vendorstate.SetVendorFilter(VendorNo,VendorName,StartDate,EndDate,AccountNo);
Vendorstate.RUNMODAL;

here I call the vendor statement page, hope get the corrected data for the subpage , but it faild..

 

Any suggestion will be warmly apprciated.

  • Your function looks correct but not sure if Vendorno, Vendorname,Startdate,EndateDate and Accountno) carry any values before the runmodal. Can you debug your code and see before the runmodal what are the values of the passed parameters. Also I would not use currpage.update(true), change it to currpage.update(false) because I have seen sometimes it throws off the filters. Also check if the data in table that belongs to vendor state page data is being updated.
  • In reply to sbhatbng:

    Hi sbhatbng, thanks for your reply, but i have debugged the parameter, it is no pb.
Related