Options

Archives!!!

demi222demi222 Member Posts: 131
This is what my customer is asking:
She makes orders and wants to archive every order before she posts them. Then she wants to be able to view the archived orders (report 405) even if they have been posted, or not.

From Purchases and Payables-> Order...she makes and order
then she chooses Function-> Archive Document.

Then she may or may not post this.

How can I make it so that she can view always her archived documents? I know of form 5167 Purchase Order Archive... I don't know how to make a document print from that form.

Please help...

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    You make a copy of report 405 and you change it to run from the 'Purchase Header Archive' and the 'Purchase Line Archive' tables. You'll probably get some compile errors for missing fields and such, but you can solve those as you go. Then you add access to the report to form 5167 and you're done. Don't forget to clearly include a caption in the report that it is an archived order.
  • Options
    demi222demi222 Member Posts: 131
    I have done this... copied report 405, and renamed it to archived orders. The problem is that my report prints out everything, except for the lines ... it won't print the Purchase Line Archive lines...

    I have been trying this for 3 days now... I don't know what else to look at...
  • Options
    WaldoWaldo Member Posts: 3,412
    Did you also re-assign the record variables in code?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    demi222demi222 Member Posts: 131
    Yes, I have... renamed everything!

    One question... the Purchase line table has a whole lot of functions... do I need to make these functions in the Purchase line archive table?
  • Options
    WaldoWaldo Member Posts: 3,412
    I don't think so. The archive is just a copy of the normal table. No validates has to be run when filling the tables.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    DenSterDenSter Member Posts: 8,304
    There's no need to create any functions. What you need to do is make sure that the dataitem link between the header table and the line table is correct. Then, you need to go through all the code associated with all dataitems above the line dataitem and check for SETFILTER or SETRANGE commands that may screw up your filtering. Then, if that still doesn't give you the result you need, you need to go through all the section code to see if THOSE have the filtering code.

    Your best best would be to turn on the debugger and run the report, step through all the code and see where you expect it to get the right records, but it doesn't.

    There's probably a variable in the report of the type 'Purchase Line" that needs to be set to the archive line and the document type filter taken off, something like that.

    Dont give up dude, this is the fun stuff!!! 8)
  • Options
    SavatageSavatage Member Posts: 7,142
    DenSter wrote:
    Dont give up dude, this is the fun stuff!!! 8)

    :-k
  • Options
    demi222demi222 Member Posts: 131
    in the copyloop section of the report... the code has the following


    PurchLine.CalcVATAmountLines(0,"Purchase
    Header",PurchArchLine,VATAmountLine);

    PurchLine.UpdateVATOnLines(0,"Purchase Header ",PurchLine,VATAmountLine);

    These are functions that are in the Purchase Line table... do I need to add the functions also to the Purchase Line archive table? Otherwise, the report wont run...
  • Options
    WaldoWaldo Member Posts: 3,412
    hm, good question.

    If I'm not mistaken, these functions are meant to fill temporary tables for printing VAT lines on the report. So, you do no harm adding these functions to the archive-tables.

    If you don't need VAT on the report, I would just delete the VAT-part of the report, including these function calls.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    demi222demi222 Member Posts: 131
    I removed whatever had to do with VAT from my report... everything shows up when I print preview except for the Purchase Line Archive lines...

    any other suggestions?
  • Options
    ArhontisArhontis Member Posts: 667
    Hi,

    Why do you want to use a report for that?

    I have done the same functionality by adding to the main menu a link to the form "Purchase Order Archive" or "Sales Order Archive" for sales...

    "Why print when you can see it on screen?"
  • Options
    WaldoWaldo Member Posts: 3,412
    :-k

    Personally, I think the default functionality is:

    when you want to print the order from the archive, first restore it as an order (an archived one is not an actual order), then print it.

    :-k

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    demi222demi222 Member Posts: 131
    for some reason, they want to be able to view the order as they sent it to their customer.

    I am able to view the purchase line archive lines... but have one problem with this...
    In the roundloop section of the report it has PurchLine.DELETEALL;

    and in the copyloop section the same thing...

    I made them into PurchLineArch.DELETEALL;

    However, this deletes the lines, and nothing can be viewed... if I comment these two out, then it prints each line twice, and continues to print from other orders, etc.

    Any ideas?

    :?
  • Options
    DenSterDenSter Member Posts: 8,304
    No no no....there is no need to recreate an order just to be able to print. You want to print from the Archive, so there is no need to recalculate any amounts. It's historical data that you display, so you can simply display the values that are in the archive tables. There are no calculate VAT functions in the archive tables simply because you don't NEED to recalculate those numbers.

    Also, don't do a DELETEALL in your report, that removes your archived data and you wont be able to report them again. Just remove those functions from your archive report and display the values. Remeber this is a report to only display historical data, so you dont need to recalculate anything, and you dont need to create/modify any records either. All you need to do is display what is in the table.
  • Options
    demi222demi222 Member Posts: 131
    If I don't do the delete all, the lines show up, however, they print out twice.. Also, the previous archived data lines also print out...

    Don't know what's happening...
Sign In or Register to comment.