[solved] Print "Phys. Inventory List" directly

tro#1tro#1 Member Posts: 122
NAV 4 SP2:

I wonder what the standard process would be:

I create a Physical Inventory Journal and want to print the "Phys. Inventory List" afterwards.

I do not even find the report in the menu "Warehouse". I have to go to menu Financial Management and print the list from there. I have to set the filter manually (Journal Template Name and Batch Name).

Is this the wanted standard way to do so? I wonder each time I want to print the list.

I then tried to call the report from the journal form directly. But I am not good in programming. It starts the report but also without any filters. Maybe you could help me with that?

Thank you

Comments

  • SavatageSavatage Member Posts: 7,142
    do you have report 10151?

    in inventory reports?
  • tro#1tro#1 Member Posts: 122
    No, the German version does not have report 10151. I checked a W-Version and do not find that report either.

    I just know report 722 Phys. Inventory List
  • SavatageSavatage Member Posts: 7,142
    you can add your eport to any menu - just click modify on the report list and add the report # to that menu.

    So you want to add a command button to the form that runs the report and you want the Journal Template Name & Journal Batch Name already filled in with the appropriate Filters is that correct?

    PS: There should be an assist button on the report that lets you lookup these names without manual entry.
  • tro#1tro#1 Member Posts: 122
    I already added the report to the form. But my filters do not work. I added in the on push control:

    "Item Journal Line2".SETRANGE("Journal Template Name","Journal Template Name");
    "Item Journal Line2".SETRANGE("Journal Batch Name","Journal Batch Name");
    REPORT.RUNMODAL(REPORT::"Phys. Inventory List");

    It opens the report but it does not set any filters.

    Yes, I can choose the needed filters manually with the assist button. I do not worry about me but I am quite sure that my coworkers will forget how and where to set the filters. Since we work with different lists and locations this could be a source of many mistakes.
  • SavatageSavatage Member Posts: 7,142
    Using a command button to open report, hense the onpush :lol:
    Add global IJL
    type record -> item Journal Line
    OnPush()
    IJL.RESET;
    IJL.SETRANGE(IJL."Journal Template Name","Journal Template Name");
    IJL.SETRANGE(IJL."Journal Batch Name","Journal Batch Name");
    REPORT.RUNMODAL(722,TRUE,FALSE,IJL);
    
  • tro#1tro#1 Member Posts: 122
    Thank you, now it works perfectly!

    This will help a lot to avoid printing journal lines of different worksheets in one list.

    I had not added an extra button but added "Print Phys. Inventroy List" as a new Menu Item to the "Function" Button.

    This is now very convenient for all users.
  • SavatageSavatage Member Posts: 7,142
    Button, Menu Item, whatever.. it's all good! \:D/
  • ReinhardReinhard Member Posts: 249
    tro:
    The important difference between Savatage and your code:

    you set the filters a recordset, but you did not pass it in as a variable. That's why it did not set filters on the report
    Here is info from Nav. F1 help:

    REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])
    [ ] indicates optional parameters
Sign In or Register to comment.