How to forcly overwrite a file in the path?

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

I am running a dataport from form's menu button and I have defined the path there in the coding as like below.
REPEAT
          CLEAR(EInvDataport);
          CLEAR(EInvDataport1);
          EInvDataport.SETTABLEVIEW(SalesInvHeader1);
          EInvDataport1.SETTABLEVIEW(SalesInvHeader1);
          EInvDataport.FILENAME('C:\ARG\EInvoice\'+ FORMAT(WORKDATE,0,'Invoice_' + SalesInvHeader1."No." +
          '_<Day,2>' + '<Month,2>' + '<Year4>') + '.txt');
          EInvDataport1.FILENAME('C:\Program Files\PyAfipWs\' + FORMAT(Text001) + '.txt');
          EInvDataport.RUNMODAL;
          EInvDataport1.RUNMODAL;
        UNTIL SalesInvHeader1.NEXT = 0;

The code is executing successfully. My need is, suppose if the same file name is already existing in the path means, it should be forcly overwrite the file. Presently it is showing the message as the file already exists. (see attachment)

How to overwrite without getting this message? Can anyone help me on this?

Thanks in advance,
Aravindh R.

Answers

Sign In or Register to comment.