Batch Update Option Field

Dave_beDave_be Member Posts: 35
I have an option field on the customer card that indicates if a customer is Active or Pasive.
Can i write a codeunit/report that automatically sets the option to "Active" if the customer had a posted sales invoice for the last 6 months?

Comments

  • Dave_beDave_be Member Posts: 35
    Maybe someone can provide me an example?
    Always risky to ask yes/no questions on a knowledge forum..
  • DaveTDaveT Member Posts: 1,039
    Dave_be wrote:
    Always risky to ask yes/no questions on a knowledge forum..
    Yes :mrgreen: - Sorry couldn't resist
    Dave_be wrote:
    Maybe someone can provide me an example?
    Easiest one to describe is to do a report (as you don't need a development license) with a dataitem based on the customer and then all similiar code:

    CLE.SETFILTER( "Customer No.", "No." );
    CLE.SETRANGE( "Posting Date", CALCDATE( '-6M', WORKDATE), WORKDATE );
    if CLE.ISEMPTY then
    Myoption := Myoption::Passive
    else
    Myoption := Myoption::Active;
    MODIFY;

    Where CLE is a record variable for the Cust. Ledger Entry
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.