Export DataPort FileName Definition

Hello

I created a new Export DataPort, and in FileName I must includ the Posting date filter, that user select on filter DataPort.

How can I do That.

This is what I Tried :

Dataport - OnInitDataport()

FileName := ‘c:\TEXT’ + recCompany.“VAT Registration No.”;

PurchRcptLineFilter := “Purch. Rcpt. Line”.GETFILTERS;
PeriodText := “Purch. Rcpt. Line”.GETFILTER(“Posting Date”);

IF recCompany.“VAT Registration No.” <> ‘’
THEN
FileName := FileName + PeriodText +’.txt’;

// This variable PeriodText is what I want to put in my file name

Ex: TEXT1234567+01012012+31032012.TXT

Dataport - OnPreDataport()

CurrDataport.FILENAME(FileName);

Did you try by Shifting the code to OnPreDataitem trigger?

You wont have filters applied in OnInit trigger…

Wich code do I have to put in OnPreDataitem trigger?

The whole code existing in Oninit trigger to before CurrDataport.FILENAME(FileName);

Thanks Mohana

So Far so Good

Welcome