Options

Dataimporting issue

tguptatgupta Member Posts: 86
Hi All ,
Can anyone tell me why it is preffered to put last field from the field designer of current dataport on the OnBeforeImportRecord Trigger as blank andthen run the dataport .

Cheers ,
Tarun

Comments

  • Options
    g_dreyerg_dreyer Member Posts: 123
    Sorry,

    Could you re-phrase your question? Where did you get the information?
    Any particular dataport that you are referring to? or could you paste your code in the window?
    Are you part of an NSC, or are you an end user?



    Regards,
    gus
  • Options
    kinekine Member Posts: 12,562
    If you want to know, why fields are cleared in OnBeforeImport trigger, it is because if the field is in file empty, old value is kept and this is wrong. Because it will "copy" values from previous imported record etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    eromeineromein Member Posts: 589
    But this isn't allways the case.

    Plus... I would use a rec.init instead of clearing the fields one by one.
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • Options
    randrewsrandrews Member Posts: 135
    So do
    IF field='' THAN
    field := DefaultValue
  • Options
    eromeineromein Member Posts: 589
    Why randrews?
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.