How to Skip lines in CSV in dataport

scs_sathishscs_sathish Member Posts: 19
edited 2014-05-30 in NAV Three Tier
Hi all,

while importing Data port i want to skip some lines in csv file... is that possible..??

e.g: im importing purchase line, purchase line has the item no. which does not exist in item master, so error says like-->item no. does not exist in the related table item..now i want to skip that line & import the remaining line...and also i want skip the document type if its not an option other than in purchase line.(the existing options are Quote,Order,Invoice,Credit Memo,Blanket Order,Return Order). If user wrongly typed an option as payment or shipment, so in that case i want to skip that line too..

thanks & regards,
Sathish

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can use
    CurrDataport.SKIP;
    
    in the OnAfterImportRecord-trigger to skip a line.

    PS: You are talking about Dataports, so this posting is in the wrong forum, right?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • scs_sathishscs_sathish Member Posts: 19
    Hi, Sorry im new to this forum..

    I have used CurrDataport.SKIP , its working fine.

    But if i used for option field, it shows error instead of skipping the line.

    For E.g: I'm importing purchase line data, in one of the line has a document type as "Shipment" but there is no shipment in document type options.the existing options are Quote,Order,Invoice,Credit Memo,Blanket Order,Return Order. so error says like--> there is no option called Shipment, the existing options are...

    In that case i need to skip that line instead of showing the error..

    Regards,
    Sathish
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Instead of importing the CSV directly in the table, use text-fields instead. Then you can validate the input, before writing to the Purchase Line table. Create some variables of type Text, and replace your Dataport Fields with these variables.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SavatageSavatage Member Posts: 7,142
    Instead of importing the CSV directly in the table, use text-fields instead. Then you can validate the input, before writing to the Purchase Line table. Create some variables of type Text, and replace your Dataport Fields with these variables.
    :thumbsup:
Sign In or Register to comment.