09 May 2011

Query Filter in form

In new form->write a method in DS->

void filterOnVendTable()
{
QueryBuildRange vendorAccountFilter;
;
vendorAccountFilter = this.query().dataSourceNo(1).addRange(fieldnum(VendTable, AccountNum));
vendorAccountFilter.value("3000..3010");
}

____
Call this method in DS->Init()
public void init()
{
super();
this.filterOnVendTable();
}

2 comments:

  1. hi
    I have a Form with Header using Student TABLE with Field as StudentId and Line Using Marks TABLE with Fields as StudendId , Subject , Result(Enum:Pass,Fail).Here my Requirement is when we open a Form it should Show only Subjects whose Result is Pass for Particular Record Selected in Header(Student Table).And when we Click a Button in Line it should show all Subjects i.e Both Pass and Fail, for particular Record Selected in Header .Here i Could Filter By writing QueryRange in Init method of Marks DataSource.But how to get all Subjects for particular Record Selected in Header i.e both passed and failed Subjects.Please help me out


    Thank You
    Chinna

    ReplyDelete
  2. thank's it's work fine with me

    ReplyDelete

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.