How to get inactive Customer/Vendor?

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

I need a logic for the below requirement.

I need a report to display the inactive customers or vendors, those who did not made any transactions for the past 1 year. Could any tell the logic for displaying the inactive customers or vendors?

Thanks in advance,
Aravindh R.

Answers

  • gerrykistlergerrykistler Member Posts: 149
    In your report do something like this in your Customer DataItem (and the same logic in the Vendor):

    CustLedgEntry.SETCURRENTKEY("Customer No.","Posting Date");
    CustLedgEntry.SETRANGE("Customer No.",Customer."No.");
    CustLedgEntry.SETFILTER("Posting Date",'%1..',CALCDATE('-1Y',TODAY));
    IF FINDFIRST THEN
    CurrReport.SKIP;

    Your report will then only show customers which do not have transactions in the last year. You could make it more flexible by having a field on the Options tab to select the time period and then use that for the CALCDATE instead of hardcoding it to one year.
    Gerry Kistler
    KCP Consultores
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks gerrykistler for your reply. But I din't get the correct output. It is displaying all the records.

    Aravindh R.
  • ChinmoyChinmoy Member Posts: 359
    The code is quite alright except that instead of "IF FINDFIRST" it shud be "IF CustLedgerEntry.FINDFIRST". I think you did this change while u copied the code. If not do it now. Also, check the other things like, did you put the code in OnAfterGetRecord trigger of Customer dataitem? Are there any other code written in the triggers which may be disrupting the normal flow of the program? etc. etc..

    Hope this helps.

    Chn
  • gerrykistlergerrykistler Member Posts: 149
    Good catch Chinmoy, my ommission.
    Gerry Kistler
    KCP Consultores
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Guys, My tonnes of thanks to you both. It worked..!! :thumbsup:
  • ChinmoyChinmoy Member Posts: 359
    :)
Sign In or Register to comment.