Report for Delete Old Quotes

elToritoelTorito Member Posts: 191
Hi,

after the Upgrade to 3.70 would like delete some "quotes", because they contents Items which have not a relation to the items table.
It concerns only quotes until a specified date.

So i would delte some quote until 30.6.2003.
But i don't know what i must search/look for make a report like this.
What Doku i must read or rather what Code i need, or can i create this with one of the wizards ?

Thanks.

PS: When i set a Filter to the date an list me all of the old quotes, mark them and press <F4> then occurs nothing.
(Oo)=*=(oO)

Comments

  • albertoalberto Member Posts: 59
    Could it be enough to put a filter in quote list and then delete what you want?
    With a filter, without a report.
    I suggest this because I don't know to make a report as you want..... :D
  • albertoalberto Member Posts: 59
    PS: When i set a Filter to the date an list me all of the old quotes, mark them and press <F4> then occurs nothing

    You have to do from object designer, if you have.
  • elToritoelTorito Member Posts: 191
    alberto wrote:
    You have to do from object designer, if you have.

    that was it, i have try delete the quotes in the Object designer but i have used the form and not in the table, no i mark them in the table sales quotes and i can delete it (from object designer).

    Thanks a lot
    (Oo)=*=(oO)
  • elToritoelTorito Member Posts: 191
    hmm.

    Other question ...

    Can it be that delete with the Object Designer is slower than if i make a report that delete it ?

    I try now make one, i take one of the standard reports for a reference perhaps it does run. :wink:

    EDIT: I have now a solution.... :!:
    I Make a Report with the Sales Header , in the Body(2) on the OnPostSection() Trigger i put a DELETE().
    That was it ... is very very faster than Select All in the Table and delete it with F4.

    I don't know why, but so is it. :? :)
    (Oo)=*=(oO)
  • fbfb Member Posts: 246
    If you used DELETE() -- instead of DELETE(TRUE), that explains why it was very fast.

    It is very likely that you have deleted the Sales Header records only, and left behind many of the following records that were related to the Sales Header:
      Document Dimensions; Opportunity; Sales Lines (and all of their children...); Warehouse Request; Sales Comment Lines; Tax Differences; etc., etc., ...
    If you run a Full Database Test now, you will most likely find many more 'orphaned' records...
  • elToritoelTorito Member Posts: 191
    fb wrote:
    If you run a Full Database Test now, you will most likely find many more 'orphaned' records...

    hmm. you have right, i'm stupid,
    i don't remind that the records are related. :oops: :oops:

    But it's no so bad, i have delete only the sales headers in my test database. i always do it when i'm not sure what i making.
    Thanks a lot for the advice.
    (Oo)=*=(oO)
  • RobertMoRobertMo Member Posts: 484
    Beside that:

    you should not put a "data manipulation" code in OnPostSection of Body Section. This trigger is usually not even used. And the code that is used in OnPreSection trigger ususally just decides if section will be outputed or not: CurrReport.SHOWOUTPUT(TRUE/FALSE) - again avoid "data manipulation" code.
    To do it more in "Navision standrad" way, you should mark your report as Processing only. You should delete all sections, unless you want to print some results.
    You should put your code in OnAfterGetRecord and calling DELETE with TRUE parm. This would be the right way to do it.

    1 more thing. By calling DELETE(TRUE) all the records are retrieved to the client before they are deleted - like deleting form object designer. If you are sure, that no code is in OnDelete trigger of table, you can try DELETEALL(FALSE). This way you will delete all records according to filters set, but the records will not be retrieved to client - this means faster ! If you use DELETEALL(TRUE) then again all records are retrieved to client and therfore no increase in speed is achieved.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • elToritoelTorito Member Posts: 191
    RobertMo wrote:
    Beside that:
    To do it more in "Navision standrad" way, you should mark your report as Processing only. You should delete all sections, unless you want to print some results.
    You should put your code in OnAfterGetRecord and calling DELETE with TRUE parm. This would be the right way to do it.

    hmm. Exists a way for see what Reports a used or how many times it was called. Navision has a lot of Standard Reports. And we have too a lot of Reports created by or vendor.

    Reason is that i don't know all the business transactions of our company, and i think a lot of reports aren't used, for keep track of i must clean a little our database.

    I think a little ... :twisted: :roll: and my Idea (if not exists any method already) make a table and list the Reports, and in the reports in someone Trigger Code that writes me in the Table, likely a Counter.

    It's Good Idea ?
    (Oo)=*=(oO)
  • RobertMoRobertMo Member Posts: 484
    As I understand, you want to count the usage of each report. No such functionality in standard Navision. The idea is ok, but it looks like you will have to change all reports, since there is no trigger outside objects that would catch it? And that is not good...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • elToritoelTorito Member Posts: 191
    RobertMo wrote:
    As I understand, you want to count the usage of each report. No such functionality in standard Navision. The idea is ok, but it looks like you will have to change all reports, since there is no trigger outside objects that would catch it? And that is not good...

    Yes, this was what i mean. You have right, change all the Reports is a lot of Work, it's no so good.
    (Oo)=*=(oO)
Sign In or Register to comment.