publish
plugins.it2be_exchange info


Servoy Properties Summary
String build
Date buildDate
String component
String licensee
Boolean returnUniqueId
String typeLicensed
Number version
String versionLicensed


Servoy Methods Summary
Boolean authenticate( IEConnection )
IEAppointment createAppointment( IEConnection )
IEAppointment createAppointment( IEConnection, String )
void createAppointmentFolder( IEConnection, String )
IEContact createContact( IEConnection )
IEContact createContact( IEConnection, String )
IEMail createMail( IEConnection )
IEMail createMail( IEConnection, String )
void createMailFolder( IEConnection, String )
IEMeeting createMeeting( IEConnection, String )
IEMeeting createMeeting( IEConnection )
IEContact createPublicContact( IEConnection )
IEContact createPublicContact( IEConnection, String )
IETask createTask( IEConnection )
IETask createTask( IEConnection, String )
void createTaskFolder( IEConnection, String )
Array<String> getAllFolders( IEConnection, String )
Array<String> getAllFolders( IEConnection )
IEAppointment getAppointment( IEConnection, String, String )
IEAppointment getAppointment( IEConnection, String )
Array<IEAppointment> getAppointments( IEConnection, String, Date )
Array<IEAppointment> getAppointments( IEConnection, String, Date, Date, String, Number, Number )
Array<IEAppointment> getAppointments( IEConnection, String, Date, Date )
Array<IEAppointment> getAppointments( IEConnection, String )
Array<IEAppointment> getAppointments( IEConnection, String, Date, Date, String )
Array<IEAppointment> getAppointments( IEConnection, String, Date, Date, String, Number )
Array<IEAppointment> getAppointments( IEConnection )
Array<IEAppointment> getAppointments( IEConnection, String, Date, Date, String, Number, Number, Date )
IEConnection getConnection( String, String, String, String, String, Boolean )
IEConnection getConnection( String, String, String, String )
IEConnection getConnection( String, String, String, String, String )
IEConnection getConnection( String, String, String, String, Boolean )
IEContact getContact( IEConnection, String )
IEContact getContact( IEConnection, String, String )
Array<IEContact> getContacts( IEConnection, String )
Array<IEContact> getContacts( IEConnection )
Array<IEMail> getMails( IEConnection, String, Date, Array<String> )
Array<IEMail> getMails( IEConnection )
Array<IEMail> getMails( IEConnection, String, Date, Array<String>, Array<String>, Boolean )
Array<IEMail> getMails( IEConnection, String )
Array<IEMail> getMails( IEConnection, String, Date, Array<String>, Array<String>, Boolean, Number )
Array<IEMail> getMails( IEConnection, String, Date, Date, Array<String>, Array<String>, Boolean, Number, Number, Number )
Array<IEMail> getMails( IEConnection, String, Date )
Array<IEMail> getMails( IEConnection, String, Date, Array<String>, Array<String> )
IEContact getPublicContact( IEConnection, String )
IEContact getPublicContact( IEConnection, String, String )
Array<IEContact> getPublicContacts( IEConnection )
Array<IEContact> getPublicContacts( IEConnection, String )
IETask getTask( IEConnection, String, String )
IETask getTask( IEConnection, String )
Array<IETask> getTasks( IEConnection, String, Date )
Array<IETask> getTasks( IEConnection, String, Date, Date )
Array<IETask> getTasks( IEConnection, Date )
Array<IETask> getTasks( IEConnection, String, Date, Date, Date )
Array<IETask> getTasks( IEConnection )
Array<IETask> getTasks( IEConnection, String )
String moveMail( IEConnection, IEMail, String )
String moveMail( IEConnection, IEMail )
Array<String> moveMails( IEConnection, Array<IEMail>, String )
Array<String> moveMails( IEConnection, Array<IEMail> )
Boolean register( String )
Boolean removeAppointment( IEConnection, String )
Boolean removeContact( IEConnection, String )
Boolean removeMail( IEConnection, String, String )
Boolean removeTask( IEConnection, String )


Servoy Properties Details


build
String  build
Returns the current version (major, minor, build)
Returns
String  build String

Supported Clients
SmartClient, WebClient, NGClient


buildDate
Date  buildDate
Returns date release date
Returns
Date  date Date

Supported Clients
SmartClient, WebClient, NGClient


component
String  component
Returns the component name
Returns
String  name String

Supported Clients
SmartClient, WebClient, NGClient


licensee
String  licensee
Returns the licensee
Returns
String  licensee String

Supported Clients
SmartClient, WebClient, NGClient


returnUniqueId
Boolean  returnUniqueId
Get/Set the object to return a unique id
Returns
Boolean  boolean

Supported Clients
SmartClient, WebClient, NGClient


typeLicensed
String  typeLicensed
Returns the type that is valid for this license
Returns
String  type String

Supported Clients
SmartClient, WebClient, NGClient


version
Number  version
Returns the current version (major, minor)
Returns
Number  version Double

Supported Clients
SmartClient, WebClient, NGClient


versionLicensed
String  versionLicensed
Returns the version that is valid for this license
Returns
String  license String

Supported Clients
SmartClient, WebClient, NGClient

Servoy Methods Details


authenticate
Boolean  authenticate( IEConnection )
Take the Connection Object and authenticate against the Exchange Server.
Parameters
IEConnection  connection  the connection

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Take the Connection Object and authenticate against the Exchange Server.
// First thing to do is create a Connection Object to store credentials and Exchange Server details
var connection = plugins.it2be_exchange.getConnection("192.168.1.69", "marcel.test", "test", "Exchange");

// Optional arguments can be:
connection.appointmentFolderName = "Agenda";
connection.contactsFolderName = "Contactpersonen";
connection.deletedFolderName = "Verwijderde items";
connection.draftsFolderName = "Concepten";
connection.inboxFolderName = "Postvak IN";
connection.publicContactsFolderName = "Openbare mappen";
connection.tasksFolderName = "Taken";

// In which timezone is the Exchange server located
connection.timeZone = "GMT+1.00";

connection.domain = "exchange.vm.com";

// Check and authenticate the Connection Object against the Exchange Server
if (plugins.it2be_exchange.authenticate(connection)) {
// Output the connection with success
application.output(connection);

// And return the connection for later use
Return connection;
} else {
// Output the connection error
application.output(connection.getAuthenticationError());

// Return a null value to inform the calling method about the failed connection
Return null;
}


createAppointment
IEAppointment  createAppointment( IEConnection )
Create an appointment.
Parameters
IEConnection  connection  the connection

Returns
IEAppointment  appointment IEAppointment

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create an appointment.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the appointment in MS Exchange
// your root folder wil always be the 'calendar' folder on the exchange server
// when you don't work with an English version please set the appointment folder name in the Connection Object
var appointment = plugins.it2be_exchange.createAppointment(connection);

// you can also create an appointment direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var appointment = plugins.it2be_exchange.createAppointment(connection, "Calendar/private");

if (appointment) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
var date1 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
var date2 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours() + 1);

appointment.subject = "subject of the appointment";
appointment.body = "body of the appointment";
appointment.startDate = date1;
appointment.endDate = date2;
appointment.location = "fun palace";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = appointment.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the appointment failed");
}


createAppointment
IEAppointment  createAppointment( IEConnection, String )
Create an appointment.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IEAppointment  appointment IEAppointment

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create an appointment.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the appointment in MS Exchange
// your root folder wil always be the 'calendar' folder on the exchange server
// when you don't work with an English version please set the appointment folder name in the Connection Object
var appointment = plugins.it2be_exchange.createAppointment(connection);

// you can also create an appointment direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var appointment = plugins.it2be_exchange.createAppointment(connection, "Calendar/private");

if (appointment) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
var date1 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
var date2 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours() + 1);

appointment.subject = "subject of the appointment";
appointment.body = "body of the appointment";
appointment.startDate = date1;
appointment.endDate = date2;
appointment.location = "fun palace";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = appointment.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the appointment failed");
}


createAppointmentFolder
void  createAppointmentFolder( IEConnection, String )
Creates and returns a new folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Creates and returns a new folder.
// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// appointment (calendar) folders are also used for meetings
// the parent folder must always be created first
globals.folderid = plugins.it2be_exchange.createAppointmentFolder(connection, "private");

// after creating the parent folder we can create the children
if (globals.folderid) {
globals.folderid = plugins.it2be_exchange.createAppointmentFolder(connection, "Calendar/private%20family");
globals.folderid = plugins.it2be_exchange.createAppointmentFolder(connection, "Calendar/private%20friends");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the folder failed");
}


createContact
IEContact  createContact( IEConnection )
Create a contact.
Parameters
IEConnection  connection  the connection

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a contact.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the contact in MS Exchange
// your root folder wil always be the contact folder on the exchange server
// when you don't work with an English version please set the contact folder name in the Connection Object
var contact = plugins.it2be_exchange.createContact(connection);

// you can also create a contact direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var contact = plugins.it2be_exchange.createContact(connection, "Contacts/private");

if (contact) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
contact.firstName = record.it2be_companies_to_it2be_contacts.firstname;
contact.lastName = record.it2be_companies_to_it2be_contacts.lastname;

contact.companyName = company_name;

// you should add a relation address here, in this case it is hard coded :)
contact.businessAddressStreet = "street 1";
contact.businessAddressCity = "city";
contact.businessAddressCountry = "country";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.it2be_companies_to_it2be_contacts.exchangeid = contact.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the contact failed");
}


createContact
IEContact  createContact( IEConnection, String )
Create a contact.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a contact.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the contact in MS Exchange
// your root folder wil always be the contact folder on the exchange server
// when you don't work with an English version please set the contact folder name in the Connection Object
var contact = plugins.it2be_exchange.createContact(connection);

// you can also create a contact direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var contact = plugins.it2be_exchange.createContact(connection, "Contacts/private");

if (contact) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
contact.firstName = record.it2be_companies_to_it2be_contacts.firstname;
contact.lastName = record.it2be_companies_to_it2be_contacts.lastname;

contact.companyName = company_name;

// you should add a relation address here, in this case it is hard coded :)
contact.businessAddressStreet = "street 1";
contact.businessAddressCity = "city";
contact.businessAddressCountry = "country";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.it2be_companies_to_it2be_contacts.exchangeid = contact.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the contact failed");
}


createMail
IEMail  createMail( IEConnection )
Create an email.
Parameters
IEConnection  connection  the connection

Returns
IEMail  email IEMail

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create an email.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// Send your email through MS Exchange mail.
// your root folder wil always be the 'outbox' folder on the exchange server
// when you don't work with an English version please set the mail and drafts folder name in the Connection Object
var mail = plugins.it2be_exchange.createMail(connection);

if (mail) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
mail.sender = "marcel.test@exchange.vm.com";
mail.to = "marcel.test@exchange.vm.com";
if (mail.cc) {
mail.cc = record.emailcc;
}
if (mail.bcc) {
mail.bcc = record.emailbcc;
}
mail.subject = "email subject";
mail.body = "email body text";

// or send an HTML message
// mail.htmlBody = "are you 
       
       
       
       
         happy 
        with the result?";

if (attachment) {
// set the path to attach a file to the email
// 	mail.createAttachment(attachment);
}

// send the email. this method returns the exchange id which can be stored for
// synchronization and other purposes
record.exchangeid = mail.send();

controller.saveData();
} else {
if (!mail.to) {
plugins.it2be_exchange.showErrorDialog("Error", "you forgot to set a mail to email message");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the email message failed");
}
}


createMail
IEMail  createMail( IEConnection, String )
Create an email.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IEMail  email IEMail

Supported Clients
SmartClient, WebClient, NGClient

Sample
js_createMail(IEConnection)


createMailFolder
void  createMailFolder( IEConnection, String )
Creates and returns a new folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Creates and returns a new folder.
// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// When you create a new folder this can be done in the 'root'
// Or you can create a complete structure
// IMPORTANT: the parent folder must always be created first
plugins.it2be_exchange.createMailFolder(connection, connection.inboxFolderName + "/servoy");

// Give the connection the time to 'recover' for the next action
application.sleep(1000);

plugins.it2be_exchange.createMailFolder(connection, connection.inboxFolderName + "/servoy/test");


createMeeting
IEMeeting  createMeeting( IEConnection, String )
Create a meeting request.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IEMeeting  meeting IEMeeting

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a meeting request.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// create the meeting in MS Exchange
// your root folder wil always be the 'calendar' folder on the exchange server
// when you don't work with an English version please set the meeting folder name in the Connection Object
var meeting = plugins.it2be_exchange.createMeeting(connection);

// you can also create an appointment direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var meeting = plugins.it2be_exchange.createMeeting(connection, "Calendar/private");

if (meeting) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
record.subject = "subject of the meeting";
record.content = "body of the meeting, created at " + today;
record.startdate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
record.enddate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours() + 1);


meeting.sender = "marcel.test@exchange.vm.com";
meeting.attendees = ["Administrator@exchange.vm.com"];
meeting.subject = record.subject;
meeting.body = record.content;
meeting.startDate = record.startdate;
meeting.endDate = record.enddate;
meeting.location = "meeting palace";

// send the request. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = meeting.send();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the meeting failed");
}


createMeeting
IEMeeting  createMeeting( IEConnection )
Create a meeting request.
Parameters
IEConnection  connection  the connection

Returns
IEMeeting  meeting IEMeeting

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a meeting request.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// create the meeting in MS Exchange
// your root folder wil always be the 'calendar' folder on the exchange server
// when you don't work with an English version please set the meeting folder name in the Connection Object
var meeting = plugins.it2be_exchange.createMeeting(connection);

// you can also create an appointment direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var meeting = plugins.it2be_exchange.createMeeting(connection, "Calendar/private");

if (meeting) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
record.subject = "subject of the meeting";
record.content = "body of the meeting, created at " + today;
record.startdate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
record.enddate = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours() + 1);


meeting.sender = "marcel.test@exchange.vm.com";
meeting.attendees = ["Administrator@exchange.vm.com"];
meeting.subject = record.subject;
meeting.body = record.content;
meeting.startDate = record.startdate;
meeting.endDate = record.enddate;
meeting.location = "meeting palace";

// send the request. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = meeting.send();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the meeting failed");
}


createPublicContact
IEContact  createPublicContact( IEConnection )
Create a contact in the public folder.
Parameters
IEConnection  connection  the connection

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a contact in the public folder.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the contact in MS Exchange
// your root folder wil always be the contact folder on the exchange server
// when you don't work with an English version please set the contact folder name in the Connection Object
var contact = plugins.it2be_exchange.createContact(connection);

// you can also create a contact direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var contact = plugins.it2be_exchange.createContact(connection, "Contacts/private");

if (contact) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
contact.firstName = record.it2be_companies_to_it2be_contacts.firstname;
contact.lastName = record.it2be_companies_to_it2be_contacts.lastname;

contact.companyName = company_name;

// you should add a relation address here, in this case it is hard coded :)
contact.businessAddressStreet = "street 1";
contact.businessAddressCity = "city";
contact.businessAddressCountry = "country";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.it2be_companies_to_it2be_contacts.exchangeid = contact.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the contact failed");
}


createPublicContact
IEContact  createPublicContact( IEConnection, String )
Create a contact in the public folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a contact in the public folder.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// create the contact in MS Exchange
// your root folder wil always be the contact folder on the exchange server
// when you don't work with an English version please set the contact folder name in the Connection Object
var contact = plugins.it2be_exchange.createContact(connection);

// you can also create a contact direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var contact = plugins.it2be_exchange.createContact(connection, "Contacts/private");

if (contact) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
contact.firstName = record.it2be_companies_to_it2be_contacts.firstname;
contact.lastName = record.it2be_companies_to_it2be_contacts.lastname;

contact.companyName = company_name;

// you should add a relation address here, in this case it is hard coded :)
contact.businessAddressStreet = "street 1";
contact.businessAddressCity = "city";
contact.businessAddressCountry = "country";

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.it2be_companies_to_it2be_contacts.exchangeid = contact.save();

controller.saveData();
} else {
plugins.it2be_exchange.showErrorDialog("Error", "creating the contact failed");
}


createTask
IETask  createTask( IEConnection )
Create a task.
Parameters
IEConnection  connection  the connection

Returns
IETask  task IETask

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a task.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// create the task in MS Exchange
// your root folder wil always be the task folder on the exchange server
// when you don't work with an English version please set the tasks folder name in the Connection Object
var task = plugins.it2be_exchange.createTask(connection);

// you can also create a task direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var task = plugins.it2be_exchange.createTask(connection, "Tasks/private");

if (task) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
var date1 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
var date2 = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1, today.getHours());

task.subject = "task subject";
task.body = "task body";
task.startDate = date1;
task.dueDate = date2;
task.status = plugins.it2be_exchange.type.taskStatus_WAITING

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = task.save();

controller.saveData();

} else {
plugins.dialogs.showErrorDialog("Error", "creating the task failed");
}


createTask
IETask  createTask( IEConnection, String )
Create a task.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
IETask  task IETask

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a task.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// create the task in MS Exchange
// your root folder wil always be the task folder on the exchange server
// when you don't work with an English version please set the tasks folder name in the Connection Object
var task = plugins.it2be_exchange.createTask(connection);

// you can also create a task direct into a subfolder, seperate the folders with '/'
// you should always follow the complete structure in the correct language like below
// var task = plugins.it2be_exchange.createTask(connection, "Tasks/private");

if (task) {
// set the data, there are many more fields available than these
// for the purpose of this sample we use fixed data
var today = new Date();
var date1 = new Date(today.getFullYear(), today.getMonth(), today.getDate(), today.getHours());
var date2 = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1, today.getHours());

task.subject = "task subject";
task.body = "task body";
task.startDate = date1;
task.dueDate = date2;
task.status = plugins.it2be_exchange.type.taskStatus_WAITING

// save the data. this method returns the unique id which can be stored for
// synchronization and other purposes
record.exchangeid = task.save();

controller.saveData();

} else {
plugins.dialogs.showErrorDialog("Error", "creating the task failed");
}


createTaskFolder
void  createTaskFolder( IEConnection, String )
Creates and returns a new folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Creates and returns a new folder.
// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// When you create a new folder this can be done in the 'root'
// Or you can create a complete structure
// IMPORTANT: the parent folder must always be created first
plugins.it2be_exchange.createTaskFolder(connection, connection.tasksFolderName + "/servoy");

// Give the connection the time to 'recover' for the next action
application.sleep(1000);

plugins.it2be_exchange.createTaskFolder(connection, connection.tasksFolderName + "/servoy/test");


getAllFolders
Array<String>  getAllFolders( IEConnection, String )
Retrieve all subfolders of the root or entered folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<String>  String[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// This way you can retrieve all folders in the root
var folders = plugins.it2be_exchange.getAllFolders(connection);
var message = "";

// Loop through the found set.
if (folders) {
for (var i = 0 ; i < folders.length ; i++) {
message += folders[i] + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("folders", message);
} else {
plugins.it2be_exchange.showErrorDialog("folders", "there are no subfolders!");
}


getAllFolders
Array<String>  getAllFolders( IEConnection )
Retrieve all subfolders of the root or entered folder.
Parameters
IEConnection  connection  the connection

Returns
Array<String>  folders String[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// This way you can retrieve all folders in the root
var folders = plugins.it2be_exchange.getAllFolders(connection);
var message = "";

// Loop through the found set.
if (folders) {
for (var i = 0 ; i < folders.length ; i++) {
message += folders[i] + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("folders", message);
} else {
plugins.it2be_exchange.showErrorDialog("folders", "there are no subfolders!");
}


getAppointment
IEAppointment  getAppointment( IEConnection, String, String )
Retrieve an appointment for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  folder  the folder
String  exchangeId  the exchange id

Returns
IEAppointment  IEAppointment

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an appointment for display and/or update purposes.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual appointment from MS Exchange
var appointment = plugins.it2be_exchange.getAppointment(connection, record.exchangeid);

if (appointment != null) {
var message = appointment.startDate + " - " + appointment.endDate + ": " + appointment.subject + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no record found");
}


getAppointment
IEAppointment  getAppointment( IEConnection, String )
Retrieve an appointment for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
IEAppointment  IEAppointment

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an appointment for display and/or update purposes.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual appointment from MS Exchange
var appointment = plugins.it2be_exchange.getAppointment(connection, record.exchangeid);

if (appointment != null) {
var message = appointment.startDate + " - " + appointment.endDate + ": " + appointment.subject + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no record found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date, Date, String, Number, Number )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date
String  filter  the filter
Number  recurring  the recurring
Number  allday  the allday

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date, Date )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date, Date, String )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date
String  filter  the filter

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date, Date, String, Number )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date
String  filter  the filter
Number  recurring  the recurring

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getAppointments
Array<IEAppointment>  getAppointments( IEConnection, String, Date, Date, String, Number, Number, Date )
Retrieve an array of appointments by daterange and (optionally) filter, recurring and allday properties.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date
String  filter  the filter
Number  recurring  the recurring
Number  allday  the allday
Date  lastModified  the last modified

Returns
Array<IEAppointment>  appointments IEAppointment[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of appointments
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// REMARK: MS Exchange doesn't offer an 'out of the box' solution to work with a 'LIKE' statement
// searching can only be done on a full string or you will have to loop through the records to find what you need
var subject = plugins.it2be_exchange.showInputDialog("Select subject", "what subject do you want to search?");

if (!subject) {
Return;
}

// to search for an appointment in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - start date
// - end date
// - filter (optional) .* = all, w.* = all subjects starting with 'w', .*the.* = all subjects containing 'the'
// .*[tT][Hh][Ee].* = all subjects containing 'the' case insensitive
// - recurring, allday (optional) -1, 1 = only allday, 1, -1 = only recurring, 0, -1 = only not recurring
// -1, 0 only not allday,  -1, -1 = get all (default)
// - set maximum # to retrieve (optional)

var start = new Date(2007,0,1);
var end = new Date();

var set = plugins.it2be_exchange.getAppointments(connection, start, end, subject);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
var start = new Date(2006,0,1);
var end = new Date();

// retrieve a set from the root
var set = plugins.it2be_exchange.getAppointments(connection, start, end);

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getAppointments(connection, "private:friends");

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var appointment = set[i];

message += appointment.startDate + " " + appointment.endDate + " " + appointment.subject + "\n";
}
} else {
message = "No appointments found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getConnection
IEConnection  getConnection( String, String, String, String, String, Boolean )
Returns connection object after authenticating. Returns null when not valid.
Parameters
String  host  the host
String  account  the account
String  password  the password
String  prefix  the prefix
String  mailbox  the mailbox
Boolean  useSSL  the use ssl

Returns
IEConnection  connection IEConnection

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Returns connection object after authenticating. Returns null when not valid.
// First thing to do is create a Connection Object to store credentials and Exchange Server details
var connection = plugins.it2be_exchange.getConnection("192.168.1.69", "marcel.test", "test", "Exchange");

// Optional arguments can be:
connection.appointmentFolderName = "Agenda";
connection.contactsFolderName = "Contactpersonen";
connection.deletedFolderName = "Verwijderde items";
connection.draftsFolderName = "Concepten";
connection.inboxFolderName = "Postvak IN";
connection.publicContactsFolderName = "Openbare mappen";
connection.tasksFolderName = "Taken";

// In which timezone is the Exchange server located
connection.timeZone = "GMT+1.00";

connection.domain = "exchange.vm.com";

// Check and authenticate the Connection Object against the Exchange Server
if (plugins.it2be_exchange.authenticate(connection)) {
// Output the connection with success
application.output(connection);

// And return the connection for later use
Return connection;
} else {
// Output the connection error
application.output(connection.getAuthenticationError());

// Return a null value to inform the calling method about the failed connection
Return null;
}


getConnection
IEConnection  getConnection( String, String, String, String )
Returns connection object after authenticating. Returns null when not valid.
Parameters
String  host  the host
String  account  the account
String  password  the password
String  prefix  the prefix

Returns
IEConnection  connection IEConnection

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Returns connection object after authenticating. Returns null when not valid.
// First thing to do is create a Connection Object to store credentials and Exchange Server details
var connection = plugins.it2be_exchange.getConnection("192.168.1.69", "marcel.test", "test", "Exchange");

// Optional arguments can be:
connection.appointmentFolderName = "Agenda";
connection.contactsFolderName = "Contactpersonen";
connection.deletedFolderName = "Verwijderde items";
connection.draftsFolderName = "Concepten";
connection.inboxFolderName = "Postvak IN";
connection.publicContactsFolderName = "Openbare mappen";
connection.tasksFolderName = "Taken";

// In which timezone is the Exchange server located
connection.timeZone = "GMT+1.00";

connection.domain = "exchange.vm.com";

// Check and authenticate the Connection Object against the Exchange Server
if (plugins.it2be_exchange.authenticate(connection)) {
// Output the connection with success
application.output(connection);

// And return the connection for later use
Return connection;
} else {
// Output the connection error
application.output(connection.getAuthenticationError());

// Return a null value to inform the calling method about the failed connection
Return null;
}


getConnection
IEConnection  getConnection( String, String, String, String, String )
Returns connection object after authenticating. Returns null when not valid.
Parameters
String  host  the host
String  account  the account
String  password  the password
String  prefix  the prefix
String  mailbox  the mailbox

Returns
IEConnection  connection IEConnection

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Returns connection object after authenticating. Returns null when not valid.
// First thing to do is create a Connection Object to store credentials and Exchange Server details
var connection = plugins.it2be_exchange.getConnection("192.168.1.69", "marcel.test", "test", "Exchange");

// Optional arguments can be:
connection.appointmentFolderName = "Agenda";
connection.contactsFolderName = "Contactpersonen";
connection.deletedFolderName = "Verwijderde items";
connection.draftsFolderName = "Concepten";
connection.inboxFolderName = "Postvak IN";
connection.publicContactsFolderName = "Openbare mappen";
connection.tasksFolderName = "Taken";

// In which timezone is the Exchange server located
connection.timeZone = "GMT+1.00";

connection.domain = "exchange.vm.com";

// Check and authenticate the Connection Object against the Exchange Server
if (plugins.it2be_exchange.authenticate(connection)) {
// Output the connection with success
application.output(connection);

// And return the connection for later use
Return connection;
} else {
// Output the connection error
application.output(connection.getAuthenticationError());

// Return a null value to inform the calling method about the failed connection
Return null;
}


getConnection
IEConnection  getConnection( String, String, String, String, Boolean )
Returns connection object after authenticating. Returns null when not valid.
Parameters
String  host  the host
String  account  the account
String  password  the password
String  prefix  the prefix
Boolean  useSSL  the use ssl

Returns
IEConnection  connection IEConnection

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Returns connection object after authenticating. Returns null when not valid.
// First thing to do is create a Connection Object to store credentials and Exchange Server details
var connection = plugins.it2be_exchange.getConnection("192.168.1.69", "marcel.test", "test", "Exchange");

// Optional arguments can be:
connection.appointmentFolderName = "Agenda";
connection.contactsFolderName = "Contactpersonen";
connection.deletedFolderName = "Verwijderde items";
connection.draftsFolderName = "Concepten";
connection.inboxFolderName = "Postvak IN";
connection.publicContactsFolderName = "Openbare mappen";
connection.tasksFolderName = "Taken";

// In which timezone is the Exchange server located
connection.timeZone = "GMT+1.00";

connection.domain = "exchange.vm.com";

// Check and authenticate the Connection Object against the Exchange Server
if (plugins.it2be_exchange.authenticate(connection)) {
// Output the connection with success
application.output(connection);

// And return the connection for later use
Return connection;
} else {
// Output the connection error
application.output(connection.getAuthenticationError());

// Return a null value to inform the calling method about the failed connection
Return null;
}


getContact
IEContact  getContact( IEConnection, String )
Retrieve a contact for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!databaseManager.hasRecords(record.it2be_companies_to_it2be_contacts) || !record.it2be_companies_to_it2be_contacts.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual contact from MS Exchange
var contact = plugins.it2be_exchange.getContact(connection, record.it2be_companies_to_it2be_contacts.exchangeid);

if (contact != null) {
var message = contact.firstName + " " + contact.lastName + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no records found");
}


getContact
IEContact  getContact( IEConnection, String, String )
Retrieve a contact for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  folder  the folder
String  exchangeId  the exchange id

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!databaseManager.hasRecords(record.it2be_companies_to_it2be_contacts) || !record.it2be_companies_to_it2be_contacts.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual contact from MS Exchange
var contact = plugins.it2be_exchange.getContact(connection, record.it2be_companies_to_it2be_contacts.exchangeid);

if (contact != null) {
var message = contact.firstName + " " + contact.lastName + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no records found");
}


getContacts
Array<IEContact>  getContacts( IEConnection, String )
Retrieve an array of contacts.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<IEContact>  contacts IEContact[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
js_getContacts(IEConnection)


getContacts
Array<IEContact>  getContacts( IEConnection )
Retrieve an array of contacts.
Parameters
IEConnection  connection  the connection

Returns
Array<IEContact>  contact IEContact[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of contacts.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// retrieve a set from the root
var	set = plugins.it2be_exchange.getContacts(connection)

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getContacts(connection, "private:friends");

var message = "";

// and loop through the result set, make sure it is not too big to avoid memory issues
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var contact = set[i];

message += contact.firstName + " " + contact.lastName + "\n";
}
} else {
message = "No contacts found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getMails
Array<IEMail>  getMails( IEConnection, String, Date, Array<String> )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since
Array<String>  sender  the sender

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String, Date, Array<String>, Array<String>, Boolean )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since
Array<String>  sender  the sender
Array<String>  recipient  the recipient
Boolean  unread  the unread

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String, Date, Array<String>, Array<String>, Boolean, Number )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since
Array<String>  sender  the sender
Array<String>  recipient  the recipient
Boolean  unread  the unread
Number  max  the max

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String, Date, Date, Array<String>, Array<String>, Boolean, Number, Number, Number )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since
Date  until  the until
Array<String>  sender  the sender
Array<String>  recipient  the recipient
Boolean  unread  the unread
Number  startIndex  the start index
Number  endIndex  the end index
Number  max  the max

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String, Date )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getMails
Array<IEMail>  getMails( IEConnection, String, Date, Array<String>, Array<String> )
Retrieve an array of email messages.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  since  the since
Array<String>  sender  the sender
Array<String>  recipient  the recipient

Returns
Array<IEMail>  emails IEMail[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of email messages.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// find
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// to search for an email in Exchange you have a maximum of seven arguments to create the search
// - connection
// - path (optional)
// - since date
// - sender (array, optional)
// - recipient (array, optional)
// - only retrieve unread email (optional)
// - set maximum # to retrieve (optional)

var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceivedString + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

// get_all
// set the content of what you want to search on.
// valid boxes for email are 'Deleted Items', 'Drafts', 'Inbox', 'Junk E-mail', 'Outbox' and 'Sent Items'
var mailbox = plugins.it2be_exchange.showSelectDialog("mailbox", "Which mailbox do you want to find mail in?", "Deleted Items","Drafts","Inbox","Junk E-mail","Outbox","Sent Items");

// IMPORTANT the mailbox should have the correct international name
var array = plugins.it2be_exchange.getMails(connection, mailbox);

var message = "";

if (array) {
for (var i = 0 ; i < array.length ; i++) {
var mail = array[i];

message += "sent: '" + mail.dateReceived + " " + mail.subject + "\n";
}
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}

break;


getPublicContact
IEContact  getPublicContact( IEConnection, String )
Retrieve a contact for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// Retrieve a contact for display and/or update purposes.
// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!databaseManager.hasRecords(record.it2be_companies_to_it2be_contacts) || !record.it2be_companies_to_it2be_contacts.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual contact from MS Exchange
var contact = plugins.it2be_exchange.getContact(connection, record.it2be_companies_to_it2be_contacts.exchangeid);

if (contact != null) {
var message = contact.firstName + " " + contact.lastName + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no records found");
}


getPublicContact
IEContact  getPublicContact( IEConnection, String, String )
Retrieve a contact for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  folder  the folder
String  exchangeId  the exchange id

Returns
IEContact  contact IEContact

Supported Clients
SmartClient, WebClient, NGClient

Sample
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// Retrieve a contact for display and/or update purposes.
// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!databaseManager.hasRecords(record.it2be_companies_to_it2be_contacts) || !record.it2be_companies_to_it2be_contacts.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual contact from MS Exchange
var contact = plugins.it2be_exchange.getContact(connection, record.it2be_companies_to_it2be_contacts.exchangeid);

if (contact != null) {
var message = contact.firstName + " " + contact.lastName + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no records found");
}


getPublicContacts
Array<IEContact>  getPublicContacts( IEConnection )
Retrieve an array of contacts from the public folder.
Parameters
IEConnection  connection  the connection

Returns
Array<IEContact>  contacts IEContact[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of contacts from the public folder.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// retrieve a set from the root
var	set = plugins.it2be_exchange.getContacts(connection)

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getContacts(connection, "private:friends");

var message = "";

// and loop through the result set, make sure it is not too big to avoid memory issues
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var contact = set[i];

message += contact.firstName + " " + contact.lastName + "\n";
}
} else {
message = "No contacts found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getPublicContacts
Array<IEContact>  getPublicContacts( IEConnection, String )
Retrieve an array of contacts from the public folder.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<IEContact>  contacts IEContact[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of contacts from the public folder.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// retrieve a set from the root
var	set = plugins.it2be_exchange.getContacts(connection)

// or retrieve a set from a subfolder system
// var set = plugins.it2be_exchange.getContacts(connection, "private:friends");

var message = "";

// and loop through the result set, make sure it is not too big to avoid memory issues
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var contact = set[i];

message += contact.firstName + " " + contact.lastName + "\n";
}
} else {
message = "No contacts found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTask
IETask  getTask( IEConnection, String, String )
Retrieve a task for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  folder  the folder
String  exchangeId  the exchange id

Returns
IETask  task IETask

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve a task for display and/or update purposes.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual appointment from MS Exchange
var task = plugins.it2be_exchange.getTask(connection, record.exchangeid);

if (task != null) {
var message = task.startDate + " " + task.status + " " + task.subject + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no record found");
}


getTask
IETask  getTask( IEConnection, String )
Retrieve a task for display and/or update purposes.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
IETask  task IETask

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve a task for display and/or update purposes.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and retrieve the actual appointment from MS Exchange
var task = plugins.it2be_exchange.getTask(connection, record.exchangeid);

if (task != null) {
var message = task.startDate + " " + task.status + " " + task.subject + "\n";

plugins.it2be_exchange.showInfoDialog("Information", message);
} else {
plugins.it2be_exchange.showErrorDialog("Error", "no record found");
}


getTasks
Array<IETask>  getTasks( IEConnection, String, Date )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  lastModified  the last modified

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTasks
Array<IETask>  getTasks( IEConnection, String, Date, Date )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTasks
Array<IETask>  getTasks( IEConnection, Date )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection
Date  lastModified  the last modified

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTasks
Array<IETask>  getTasks( IEConnection, String, Date, Date, Date )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection
String  folder  the folder
Date  startDate  the start date
Date  endDate  the end date
Date  lastModified  the last modified

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTasks
Array<IETask>  getTasks( IEConnection )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


getTasks
Array<IETask>  getTasks( IEConnection, String )
Retrieve an array of tasks.
Parameters
IEConnection  connection  the connection
String  folder  the folder

Returns
Array<IETask>  tasks IETask[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Retrieve an array of tasks.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

var set = plugins.it2be_exchange.getTasks(connection);

var message = "";

// and loop through the found set. it is here that you would include your replacement like statement
if (set.length > 0) {
for (var i = 0 ; i < set.length ; i++) {
var task = set[i];

message += task.startDate + " " + task.status + " " + task.subject + "\n";
}
} else {
message = "No tasks found.";
}

if (message) {
plugins.it2be_exchange.showInfoDialog("find result", message);
} else {
plugins.it2be_exchange.showErrorDialog("find result", "no records found");
}


moveMail
String  moveMail( IEConnection, IEMail, String )
Move email message
Parameters
IEConnection  connection  the connection
IEMail  email  the email
String  folder  the folder

Returns
String  url String

Supported Clients
SmartClient, WebClient, NGClient


moveMail
String  moveMail( IEConnection, IEMail )
Move email message
Parameters
IEConnection  connection  the connection
IEMail  email  the email

Returns
String  url String

Supported Clients
SmartClient, WebClient, NGClient


moveMails
Array<String>  moveMails( IEConnection, Array<IEMail>, String )
Move email messages
Parameters
IEConnection  connection  the connection
Array<IEMail>  emails  the emails
String  folder  the folder

Returns
Array<String>  urls String[]

Supported Clients
SmartClient, WebClient, NGClient


moveMails
Array<String>  moveMails( IEConnection, Array<IEMail> )
Move email messages
Parameters
IEConnection  connection  the connection
Array<IEMail>  emails  the emails

Returns
Array<String>  urls String[]

Supported Clients
SmartClient, WebClient, NGClient


register
Boolean  register( String )
Register your runtime license (use the Components Manager to request your license string)
Parameters
String  license  the license

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// You have to register your plug-in(s) and beans before you start using them
// One way to do so is create an 'onOpenSolution' method and add the 'register(.)' method(s) there
plugins.it2be_exchange.register("Insert the license string(s) from your '*_runtime_license.txt' file here!");


removeAppointment
Boolean  removeAppointment( IEConnection, String )
Remove an appointment.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Remove an appointment.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and remove the actual appointment from MS Exchange
var result = plugins.it2be_exchange.removeAppointment(connection, record.exchangeid);

if (result) {
record.exchangeid = null;

controller.saveData();

plugins.it2be_exchange.showInfoDialog("Information", "removed the appointment!");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "could not remove the appointment!");
}


removeContact
Boolean  removeContact( IEConnection, String )
Remove a contact.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Remove a contact.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!databaseManager.hasRecords(record.it2be_companies_to_it2be_contacts) || !record.it2be_companies_to_it2be_contacts.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and remove the actual contact from MS Exchange
var result = plugins.it2be_exchange.removeContact(connection, record.it2be_companies_to_it2be_contacts.exchangeid);

if (result) {
record.it2be_companies_to_it2be_contacts.exchangeid = null;

controller.saveData();

plugins.it2be_exchange.showInfoDialog("Information", "removed the contact!");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "could not remove the contact!");
}


removeMail
Boolean  removeMail( IEConnection, String, String )
Remove an email message.
Parameters
IEConnection  connection  the connection
String  folder  the folder
String  exchangeId  the exchange id

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Remove an email message.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and remove the actual email from MS Exchange
var result = plugins.it2be_exchange.removeMail(connection, record.exchangeid);

if (result) {
record.exchangeid = null;

controller.saveData();

plugins.it2be_exchange.showInfoDialog("Information", "removed the email message!");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "could not remove the email message!");
}


removeTask
Boolean  removeTask( IEConnection, String )
Remove a task.
Parameters
IEConnection  connection  the connection
String  exchangeId  the exchange id

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Remove a task.
var record = foundset.getRecord(foundset.getSelectedIndex());

// While working with only one connection you can use a global to define it
// For further use of the Connection Object please see the getConnection sample data
var connection = globals.getConnection();

// return when no record available
if (controller.getSelectedIndex() < 0) {
Return;
}

// check the stored id in the database
if (!record.exchangeid) {
plugins.it2be_exchange.showErrorDialog("Error", "No exchange (unique) id found");

Return;
}

// and remove the actual task from MS Exchange
var result = plugins.it2be_exchange.removeTask(connection, record.exchangeid);

if (result) {
record.exchangeid = null;

controller.saveData();

plugins.it2be_exchange.showInfoDialog("Information", "removed the task!");
} else {
plugins.it2be_exchange.showErrorDialog("Error", "could not remove the task!");
}