Comparing fields in report from same table

shogan@mila.ieshogan@mila.ie Member Posts: 113
edited 2003-08-14 in Navision Attain
Hi all,

Just a quickie, as I am a newbie: I am trying to compare two integer fields in the Item Table (27) - Inventory and Reorder Point.

What I want is for the report to display items where the Reorder Point < Inventory.

My problem is in the DataItemTableView I want:
SORTING(No.) ORDER(Ascending) WHERE(Inventory=FILTER(< "Reorder Point"))

But I keep getting an error saying that I cannot enter Reorder Point)) in Decimal....

I have tried using a Global called Reorder, setting it to integer;

so that I could write
    Reorder := Item."Reorder Point"
in OnAfterGetRecord() trigger, but the same error appears.

Would appreciate any help.

Thanks

Stephen

Comments

  • StephenGStephenG Member Posts: 99
    Stephen

    You can't set the filter Inventory FILTER < "Reorder Point" in The DataItemTableView.

    What you need is a short bit of Code in the OnAfterGetRecord Trigger

    CALCFIELDS(Inventory);
    IF Inventory >= "Reorder Point" THEN
    CurrReport.SKIP;

    With the Calcfields you can code it like this or you can set the Calcfields property on the DataItem.

    I hope this helps you.
    Answer the question and wait for the answer.
  • shogan@mila.ieshogan@mila.ie Member Posts: 113
    Thanks a million for that - it worked perfectly :D .

    Just one more question, if you do not mind :? .

    I would like for the values the user enters for the filters I set up to persist (ReqFilterFields property), so that when the report is opened every time, it remembers the last set of values entered.


    Thanks once again.

    Stephen
  • StephenGStephenG Member Posts: 99
    Hi Stephen

    The values the user enters for the filters set up on ReqFilterFields property are always saved. Unless the Object has been recomplied or the users Zup filehas been reset.

    On the RequestOptionsForm you need to set the property SaveValues to Yes, but again these values will be lost if the object has been recompiled or the Zup file reset.
    Answer the question and wait for the answer.
  • shogan@mila.ieshogan@mila.ie Member Posts: 113
    Hey Steve G

    Thanks for that - indeed you are correct!

    So now I have finished my first report.... :D


    Stephen
  • eromeineromein Member Posts: 589
    Nice one Shogan!
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.