Is is possible to filter records from the Temp Record var

pawanppawanp Member Posts: 90
Suppose i have temp variable of item records(ItemTemp) with some records.
And i want to filter variable item records(Items) with temp variable(ItemTemp).
How to do that?? Please help me with the code. Thanks

Comments

  • rmpatel22rmpatel22 Member Posts: 80
    You can filter it with same commands SETFILTER and SETRANGE
    Rakesh Patel
    Navision Developer
  • pawanppawanp Member Posts: 90
    Can u help me out with the code. As the parameter for SETFILTER function is Field and value.
  • rmpatel22rmpatel22 Member Posts: 80
    ItemTemp - Temporary Record variable for Item table
    Items - Record variable for Item table

    If ItemTemp having filter on "No." field then,

    Items.SETFILTER("No.",ItemTemp.GETFILTER("No."));
    Rakesh Patel
    Navision Developer
  • pawanppawanp Member Posts: 90
    ItemTemp is not having any filter. Its only having few records.
    I want to apply filter to Item Variable based on few records on Itemtemp variable.
  • rmpatel22rmpatel22 Member Posts: 80
    edited 2010-09-01
    Why you want to do this? What is your exact requirement?

    Instead of this you can do process like,

    IF ItemTemp.FIND('-') THEN REPEAT BEGIN (Sorry, before I written GET instaed of FIND, now corrected it)
    IF Items.GET(ItemTemp."No.") THEN BEGIN
    //You can write your code here for Items record
    END;
    END UNTIL ItemTemp.NEXT = 0;
    Rakesh Patel
    Navision Developer
  • kinekine Member Posts: 12,562
    rmpatel22 wrote:
    Why you want to do this? What is your exact requirement?

    Instead of this you can do process like,

    IF ItemTemp.GET('-') THEN REPEAT BEGIN
    IF Items.GET(ItemTemp."No.") THEN BEGIN
    //You can write your code here for Items record
    END;
    END UNTIL ItemTemp.NEXT = 0;

    What is "GET('-')"? You mean "FIND('-')"? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • lvanvugtlvanvugt Member Posts: 774
    A small note on this:
    you can perform any action you can on a table also on a temp table (based on a temporary record variable)
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
Sign In or Register to comment.