Delete a file without FileSystem extension

Delete a file without FileSystem extension

  

Is there a way to delete a file without using the File_Delete action in the FileSystem extension?  File_Delete has its own error handler, which writes to the ServiceCenter log, which for my purposes, is undesirable behavior.

Is there a way to delete a file such that I could write my action without using that, where I can set Log Error to No and capture/record the error with my own methods?

The short version is: we have an old file purge timer that records every error, and if there's an error, it fills up the OS_LOG tables.  I wrote a new file purge timer that intended to write the unique errors only to a separate table, but because File_Delete handles its own errors (rather than, say, passing them back up the stack for my handler), I need to see about handling my own file deletion, but I honestly am unsure how to do that with OutSystems.

Any help is much appreciated.

Hi Chris.

The easiest way to have that feature with the requirements you want is to create your own extension with all the error handling you need.

You can also go to Service Center and try to play around with the option Activity Logging to see if it works for you:

Hi Goncalo,

You can simply open the file extension in visual studio and change it as per your requirement or else you can create your own extension.

Gonçalo Martins wrote:

Hi Chris.

The easiest way to have that feature with the requirements you want is to create your own extension with all the error handling you need.

You can also go to Service Center and try to play around with the option Activity Logging to see if it works for you:


I think the activity logging does not apply to error handling, just to slow calls.


Pramod Jain wrote:

Hi Goncalo,

You can simply open the file extension in visual studio and change it as per your requirement or else you can create your own extension.

I would definitely not change the existing extension, because a component upgrade would undo those changes. Please, do not create your custom version of a system component (or a forge component, for that matter).

Hi ChrisV,

Here is one very simple extension i created to delete the files , it wont write anything to SS as i handled the error and returning the flag , if there is any error you will get error flag will be true and you will also get the error message else if error flag is false means file deleted successfully . Please see the attached extension.


Hi Goncalo,

I dont meant to change the system component which is already there , my intention is just to say that if there is something specific required it can always be done by writing your own extension.

Fileextension component is really very good as a part of system component and i am also using it in almost every project.

Leonardo Fernandes wrote:

Gonçalo Martins wrote:

Hi Chris.

The easiest way to have that feature with the requirements you want is to create your own extension with all the error handling you need.

You can also go to Service Center and try to play around with the option Activity Logging to see if it works for you:


I think the activity logging does not apply to error handling, just to slow calls.


Pramod Jain wrote:

Hi Goncalo,

You can simply open the file extension in visual studio and change it as per your requirement or else you can create your own extension.

I would definitely not change the existing extension, because a component upgrade would undo those changes. Please, do not create your custom version of a system component (or a forge component, for that matter).

If you read correctly my post you'll notice that I never referred anything about changing the extension, that is a golden rule, don't change extensions from system components nor forge, or you won't be able to update them.

I wrote specifically to create your own extension for custom/extended scenarios.

About the Activity Logging, I think you're correct.