Dataport newbie

mamacitamamacita Member Posts: 3
I have added a new Boolean field to the tabel Sales Header and I did the same for the other three related tables 110,112, 114.
The new field is going to indicate wether or not the sales data was printed. A dataport exports data to a file,and then it's printed.
This works fine.
So after some data is exported, some code sould set the new boolean field to true.
I was thinking to write it in Sales Header - OnAfterExportRecord().
Am I on the rigth track?
An example would be great. :)

Comments

  • SavatageSavatage Member Posts: 7,142
    edited 2008-10-08
    OnAfterExportRecord()
    "Your Boolean" := TRUE;
    "Sales Header".MODIFY;

    Welcome to Mibuso, Note; you posted in the wrong forum - the moderator will move this post.
    It should have been in the one listed as
    NAV/Navision
    Version >= 3.70 and <= 5.0
    Discuss all NAV topics here (both functional/technical).
  • mamacitamamacita Member Posts: 3
    thanx :D
  • SavatageSavatage Member Posts: 7,142
    technically it won't
    The new field is going to indicate wether or not the sales data was printed

    It will tell you if the dataport exported the data.
    In fact you can also add to the dataport to only export sales headers that DO NOT have that boolean field checked. That way it can be only exported once automatically.

    We export addresses to an outside application. and we use a boolean on the header too, once exported. I'm using a report instead of a dataport & the excel buffer to export the data.
    I've also added a request form that allows me to Re-export incase something goes wrong and it needs to be redone.
    it's as simple as changing the SETRANGE
    OnPreDataItem()
    IF NOT ReCreate THEN   "Sales Header".SETRANGE("Sales Header"."My Boolean",FALSE)
    ELSE   "Sales Header".SETRANGE("Sales Header"."My Boolean",TRUE);
    

    If you need to add such functionality - you can think about adding a CurrDataport.SKIP;

    Anyway, you'll cross that bridge if you need to.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.