Dataport Export Customer Table

viriatoviriato Member Posts: 105
I want to export all the customers that have been manipulated over the year 2008 in the table "Cust. Ledger Entry"

What would be the most recommended way to do it?


Thanks ahead. A nice weekend to all.

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi,

    Do a dataport off the customer table. In the Onbeforeexportrecord do a check if there is any customer ledger entries and skip the customer if none found.

    e.g.

    CLE.reset;
    CLE.setrange( "customer no.", customer."no." );
    CLE.setfilter( "posting date", '01/01/08..31/12/08' );
    if NOT CLE.findset then
    Currdataport.skip;

    where CLE is a variable of type record subtype Cust. Ledger Entry
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • DenSterDenSter Member Posts: 8,305
    DaveT wrote:
    if NOT CLE.findset then
    Currdataport.skip;
    You don't want to do that, because that way the system actually retrieves all CLE's for the customer. Since you're not doing anything with those CLE's that is a complete waste of energy. Better:
    IF CLE.ISEMPTY THEN BEGIN
      CurrDataport.SKIP;
    END;
    
  • viriatoviriato Member Posts: 105
    Absolutelly brilliant. Big thanks.
  • DaveTDaveT Member Posts: 1,039
    DenSter wrote:
    [
    You don't want to do that, because that way the system actually retrieves all CLE's for the customer. Since you're not doing anything with those CLE's that is a complete waste of energy. Better:

    Good point :oops:
    Dave Treanor

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