Record Variable

-matrix--matrix- Member Posts: 103
Hi Guys!
I Have a record variable and I would filter it so as extract records that have two field with different values.
For Example filter all Record with quantity <> quantity shipped.
I try with setfilter(RecordVAR.field','<>%1',RecordVAR.field2) but it doesn't work because i don't use cycle REPEAT UNTIL.
Any idea?
Thanks..

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    where did you write this code and what is your exact requirement?
  • NehaprNehapr Member Posts: 59
    Hi,

    You can use setrange to filter that rather than setfilter ..........
  • -matrix--matrix- Member Posts: 103
    Thanks Mohana!
    I use it in a Codeunit for Filter records with 'qty' < > 'qty shipped' but without use cycles
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I just tried to execute same code in report..
    but <> it worked in SQL database not in native..
    i will investigate more..
  • SogSog Member Posts: 1,023
    This won't work.
    Because the filters are static, not dynamic: not dependend on the selected record.
    The current code I see is (if the recordset has not been fetched) filterd on "qty <> 0"
    (if the recordset has been fetched) filterd on "qty <> 'first record in recordset'."qty shipped"
    I see no other option than to loop the recordset and compare the fields.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • -matrix--matrix- Member Posts: 103
    Thanks for the replies.
    I solved with only way, the loop on record variable.
    Thanks
  • krikikriki Member, Moderator Posts: 9,110
    How about:
    SETFILTER("Outstanding Quantity",'<>%1','');
    

    "Outstanding Quantity" is Quantity - "Quantity Shipped".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.