Dataport DataItemSeparator

Peter_PardonPeter_Pardon Member Posts: 16
Hello,

I have a problem regarding dataports

Every day i export all invoices and credit notes to send them to a factoring company

I now have a dataport With 4 dataitems
1: integer -> 1 header record
2: Sales Invoice Header -> all invoices of that day
3: Sales Cr.Memo Header -> all credit notes of that day
4: integer -> 1 footer record with control numbers

the dataitemseperator is <NewLine>

This works fine except if there are no credit notes that day, in that case navision will leave a blank line between dataitem 2 and 4. And my file is rejected by the factoring company.

Is there a simpel to make the system not a newline when there is a dataitem with no records within the filter?

As i look now the only alternatif that i have is to put the Sales Invoice Header and the Sales Cr.Memo Header in a temporary table and export those values.

If there is anybody with a better alternative?

thanks in advance?

Greetings Peter

Comments

  • amunozsuamunozsu Member Posts: 30
    Hi,

    You could try something like that in the "OnPreDataItem" trigger:
    IF COUNT = 0 THEN
       CurrDataport.BREAK;
    

    -- Alejandro --
  • Peter_PardonPeter_Pardon Member Posts: 16
    many thanks

    It worked
Sign In or Register to comment.