Manage Learn to apply best practices and optimize your operations.

Cleaning Up Export Files To Avoid "File Already Exists" Prompt via Java Agent

I recently designed an export function for transfers from Notes to Word. But the file I pointed to in the export is obviously generated to the same place every time I export ... which brings up this annoying "File Already Exists" prompt, with the option to replace or cancel. This was designed for the sales reps, and you know how impatient sales guys are. This Java agent is an override of sorts. Must be allowed to run unrestricted Java agents. Runs manually from agent list, run once (@command may be used)


import lotus.domino.*;
import java.io.*;
//by A. Young 2000
//cleans up files created by export agent

public class JavaAgent extends AgentBase {

public void NotesMain() {

try {
File exportFile = new File("</path/filename of exported doc>");
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
exportFile.delete();

} catch(Exception e) {
e.printStackTrace();
}
}
}

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close