Published in:

Blog

·

·

Remove file by end of month using IsEndOfMonth function

·

This custom trigger function is used to delete a file by end of month. This function use system date or custom date as a parameter.

SeeHow to Create Custom Trigger Functionsfor details on installation.

Downloads

Source code and build instructions

How to Delete a File using IsEndOfMonth Function

Let me now show you how to implement that.

1. Make sure you have IsEndOfMonth function installed

Before creating a custom trigger using function IsEndOfMonth, you need to havebuildinstalled in the

server where JSCAPE MFT Server is running.

2. Create a Trigger to Delete a File by End Of Month

Login into admin console of JSCAPE MFT Server > Triggers and ClickAddto create a Trigger

Give the trigger aNameand then select the Current Timeevent type from the drop-down list.

is_end_of_month_img1

Click Next to Step 2 where a condition can be set to execute the trigger.Now ClickFunctionsbutton to

select the IsEndOfMonth function.

IsEndOfMonth function has two method signatures

– IsEndOfMonth(yyyy,mm,dd)

This method signature is used to check whether a specific day falls by end of month. In order to make this method to function need to pass the year in YYYY,MM, DD format.

For example, In order to check whether31st August 2018 falls by end of month, the parameters should be passed as IsEndOfMonth(2018,08,31)

– IsEndOfMonth(date)

This method signature is used to check whether the current day falls by end of month. In order to make this method to function need to pass the system date as parameter.System date can be retrieved using CurrentDate() Method

Use the method as below in order to check whether current day falls by end of month;

IsEndOfMonth(CurrentDate())

is_end_of_month_img2

Since the event type is Current Time, on what time the trigger should be executed should be set along with the IsEndOfMonth function.

If the Trigger need to run on every day 10 PM add the condition Hour=22 along with IsEndofMonth(CurrentDate()) method as shown below

is_end_of_month_img3

On Step 3 an action has to be added, in order to add an action clickAddbutton and select the action “Delete File” from drop down list and Click OK

is_end_of_month_img4

On OK there will be a parameterto input the file name to delete.

is_end_of_month_img5

Input the required file to delete as above, ClickOkto save the settings.

That’s it. Now you know how to use the custom function IsEndOfMonth and delete a file by end of month.

Downloads

Download JSCAPE MFT Server

Latest Articles