"Qty. on order" not calculating properly

COIBoyCOIBoy Member Posts: 17
I have modified the sales history report to display the quantities on hand by using the appropriate fields from the Item table. When I drop in the field "quantity on purchase order", only one item shows quantity even though by running the object designer and opening up the item table directly, I show the field populated on MORE than just one item. As well as just knowing that there is an open purchase order for more than just the one item. Is there anything I have to put int the OnAfterGetRecord or something to get Navision to accurately display the data? Or maybe another method? Please help. ](*,)

Answers

  • DenSterDenSter Member Posts: 8,307
    That field is probably a flowfield, so you will need to do a CALCFIELD on that field in the OnAfterGetRecord trigger.
  • COIBoyCOIBoy Member Posts: 17
    I did that and it still only show quantity on one item. I also dropped it in the Calcfields section in the item properties with no results. I am thinking I may have to go another route.
  • mrQQmrQQ Member Posts: 239
    check filters, thats all there can be
  • COIBoyCOIBoy Member Posts: 17
    Where would the filters be? I checked the c/al code as well as the C/AL globals and I'm still not seeing any reason why only one item shows outstanding order quantities when there should be dozens more items.
  • navisi0nenavisi0ne Member Posts: 36
    are you sure about the field name?
    Maybe you're using Qty. on Prod. Order instead of Qty. on Purch. Order :?:
  • COIBoyCOIBoy Member Posts: 17
    Thanks for the tip but I have indeed checked the field name.

    What's interesting is that if I sort the report by vendor number instead of item number, a different item shows quantity. It seems that the report is only pulling up the first item on the report so it IS calculating them correctly but only displaying the first one it finds.

    Please help, I'm lost on what to even try next.
  • David_CoxDavid_Cox Member Posts: 509
    edited 2006-04-20
    I would agree with the filter, maybe there is something that is causing the problem.

    Is the report run on the Item record?
    You say sorting by "Vendor No.", its not filtering the Purchase Qty lines by The Item Vendor No. is it?

    If it is and the Item Vendor is different from the one on the purchase order, No Value.

    Check this first
    OnPreReport
    MESSAGE('%1',Item.GETFILTERS);
    Have a look at what They are

    If you are happy then
    Create another Variable for the Item table, get the item and do your "Qty. On Purchase Order"

    On PreReport
    Item2.RESET;
    //Only copy the filters you want across, look at how the syntax is for this one, I am not on Navision at home.
    Item.CopyFilter(Item2.FieldName,FieldName)

    On after Get Record
    Item2.SETRANGE("No.",Item."No.");
    Item2.CALCFIELDS("Qty. on Purchase Order");
    // Update the value, it's a flowfield and it won't do any harm :roll:
    "Qty on Purchase Order" := Item2."Qty. on purchase Order"
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • COIBoyCOIBoy Member Posts: 17
    Thank you very much for your help,

    When I said "sorting by Vendor No." I just mean clicking the sort button button before running the report and choosing a different key.

    The report is run on the Item record. I have double cheked a few PO's and made sure that the vendor no's were all correct and the same as what is on the Item card

    When I run the report the only filters I am using is:
    Qty. on Purch. Order = >0
    If I use a different filter (such as Vendor or Inventory Posting Group) I get more than one result but the Qty. on Purch. Order field is always 0

    I'm going to try your suggestion about creating another variable right now an I will let you know how it works out.
  • David_CoxDavid_Cox Member Posts: 509
    COIBoy wrote:
    Thank you very much for your help,

    If I use a different filter (such as Vendor or Inventory Posting Group) I get more than one result but the Qty. on Purch. Order field is always 0

    I'm going to try your suggestion about creating another variable right now an I will let you know how it works out.

    It would be worth looking at the flowfield to see what filters affect the "Qty. on Purchase Order".
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • David_CoxDavid_Cox Member Posts: 509
    COIBoy wrote:
    When I run the report the only filters I am using is:
    Qty. on Purch. Order = >0

    Rather than filtering on a flow field, which might be part of the problem
    Maybe better on the Section,
    Currreport.SHOWOUTPUT("Qty. on Purch. Order"=>0);

    If you want to be able to report any value, the just add a flag and label to the request form, and a boolean variable ShowGreater then if checked.
    IF ShowGreater THEN
    Currreport.SHOWOUTPUT("Qty. on Purch. Order"=>0);
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • COIBoyCOIBoy Member Posts: 17
    Good thinking!

    Document Type=CONST(Order),Type=CONST(Item),No.=FIELD(No.),Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),Location Code=FIELD(Location Filter),Drop Shipment=FIELD(Drop Shipment Filter),Variant Code=FIELD(Variant Filter),Expected Receipt Date=FIELD(Date Filter)

    these are the filters on the Item table for the field "Qty. on Purch. order"
  • David_CoxDavid_Cox Member Posts: 509
    I know you said you were not filtering by "Location Filter"or any "Date Filter", these ones could cause a problem, if you was filtering sales for a specific location, but you receive to another Location, and the date filter could give problems as well, as the expected receipt date could be in the future, Delivery Monday, and you might be filtering sales up to Friday, so the purchase lines would not show.

    So maybe the second variable is the way to go, with no location or date filter applied, how about dimensions 1 and 2 are these filtered?

    Anyway I think you should be able to sort it now! \:D/

    Its 23:15 in the UK, [-( any more! :-({|=
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • COIBoyCOIBoy Member Posts: 17
    First off I want to thank David Cox for all your help. I managed to get the data to show up by following your advice.

    Thanks again guys!
Sign In or Register to comment.