Inserting Logs for the Files Sent to the Trading Partner
You can also insert the logs for the files sent to your Trading Partners by defining a trigger as described in the below steps:
-
Create a trigger with Event Type selected as "Directory Monitor File Added".

-
Click Next and move forward to define the trigger action.
-
On the Trigger Action window, click Add.
-
Select the Trigger Action as "SQL Query" and click OK.

-
Define the SQL Query parameters and click OK.
Use the following QUERY in the SQL Query trigger action:
INSERT INTO AU_AS2LOG(AU_LOCAL_DIR, AU_DOMAIN_NAME, AU_FILE_NAME, AU_FILE_SIZE, AU_FILE_MODIFICATION_TIME,
AU_TIMESTAMP, AU_TYPE, AU_STATUS) values('%Directory%', '%DomainName%', '%Name%', '%FileLength%',
'%FileModificationTime%', unix_timestamp('%Year%%Month%%DayOfMonth% %Hour%:%Minute%:%Second%')*1000+%Millisecond%, 'OUTBOUND', 'Ready to send') -
After that add a new trigger action as "Trading Partner Regex file Upload" to send files to your Trading Partner.

-
Click OK and add the details.
-
After that again add a new "SQL Query" trigger action to log the status of the file send to the Trading Partner into the Log database.
-
Select the Trigger Action as "SQL Query" and click OK.

-
Define the SQL Query parameters and click OK.
Use the following QUERY in the SQL Query trigger action:
UPDATE AU_AS2LOG SET AU_STATUS='SENT' WHERE AU_FILE_NAME='%Name%'
-
Click OK.
-
Select the newly created trigger and click OK.