Inventory Valuation

RikarddoRikarddo Member Posts: 80
I used report from NAV 2017 - R1001 - Inventory Valuation, to create a new report that could group by location. Because in the original report i can take the results of all Locations or filter by a specific.

My goal is to show all locations .

I added Location as Data Item, and indented Item , and dataitemlink by Code - Location Filter

Then in Code replaced :

//ValueEntry.SETFILTER("Location Code",GETFILTER("Location Filter"));
ValueEntry.SETFILTER("Location Code",Location.Code);

//ItemLedgEntry.SETFILTER("Location Code",Item.GETFILTER("Location Filter"));
ItemLedgEntry.SETFILTER("Location Code",Location.Code);



The original map takes about 2 minutes for all data, tis new map cant generate at all no data(20 minutes nd nothing). Except if i put some filters before generate the report, for example one location or one item.



What i am missing here?

Thanks for help

Answers

  • KTA8KTA8 Member Posts: 398
    first if the location filter isn't something the user can't choose, you should use setrange instead. You can also should use another key that uses location code instead the default one that should use entry nº
  • RikarddoRikarddo Member Posts: 80
    edited 2022-07-15
    If I replace
    ItemLedgEntry.SETFILTER("Location Code",Location.Code)
    
    for
    ItemLedgEntry.SETRANGE("Location Code",Location.Code);
    
    the behaviour is similiar
    Please any help?
  • KTA8KTA8 Member Posts: 398
    Rikarddo wrote: »
    If I replace
    ItemLedgEntry.SETFILTER("Location Code",Location.Code)
    
    for
    ItemLedgEntry.SETRANGE("Location Code",Location.Code);
    
    the behaviour is similiar
    Please any help?

    Did you give it a try using setcurrentkey with a key that includes location?
Sign In or Register to comment.