Newbie here...storing and passing a value from/to dataports

lpolliardlpolliard Member Posts: 6
edited 2004-11-08 in Navision Attain
After exporting information to an external file via a dataport I want to store the last entry id number. This stored value will be recalled when the same dataport is executed a second time to filter out records already exported. A detail explanation of how to accomplish this will be much appreciated.

Thanks :P

Comments

  • Kim_KjærgaardKim_Kjærgaard Member Posts: 17
    I dont think there is a easy solution here, you can do it by putting the id into a database, and the restore the value when you run the report.

    I can give you code for it, if you have developer access to C/AL.
  • Dean_AxonDean_Axon Member Posts: 193
    how about an alternative ???

    Create a new boolean field on the table that you are exporting and then after each record that has been exported, update this field.

    This means that next time you run the dataport you can pre-filter on the updated field being set to false.

    i.e.

    in the C/al of the dataport, look for the following trigger:
    OnAfterExportRecord()

    Once you have this then use code similar to this:
    myfield:=true
    modify;
    

    should be as easy as that :D
    Remember: Keep it simple
  • lpolliardlpolliard Member Posts: 6
    I started out with this solution but learned that I could not modify a table (Check Ledger Entry) containing posted items without a special developers license. My solution was to store the Entry Id as part of the Company Information table in a newly created field and modify it after each pass of the dataport. I was having a problem with modifying this field. Thanks to your reponse it may have been because I left out the command line "modify;". I will research the use of this command in the help files and give it a try.

    Thanks.
  • Dean_AxonDean_Axon Member Posts: 193
    I started out with this solution but learned that I could not modify a table (Check Ledger Entry) containing posted items without a special developers license

    Not strictly true. Give the dataport permission to modify the "Check Legder Entry" table. Only problem is that you need a developer licence to actually add permission to the dataport for the table you mentioned.

    However, this is only a 30 second modification and that if you speak to your NSC, then i'm sure that they can do this minor task for you ??
    Remember: Keep it simple
Sign In or Register to comment.