Show/Hide Toolbars

You use the API to create a Java class for the scheduled action. After you have a file for the Java class, you can add it to the Scheduled Actions folder in TeamConnect and select it from the Actions drop-down list.

The action in the following code sample retrieves a text parameter, creates a new person contact, and adds an address to the contact.

import com.mitratech.teamconnect.enterprise.api.model.Contact;

import com.mitratech.teamconnect.enterprise.api.model.Address;

import com.mitratech.teamconnect.enterprise.api.service.ContactService;

import com.mitratech.teamconnect.enterprise.api.custom.ScheduledCustomAction;

 

public class SampleActionClass extends ScheduledCustomAction {

 

@Override

public void action() {

//Retrieve the contact service from platform.

final ContactService contactService = platform.getContactService();

 

//retrieves a text parameter

String paramCity = getParameters().getTextParameterValue("city");

 

//create a new contact of type person.

Contact cont = contactService.newPerson("firstName", "lastName");

//add a business address to the new contact.

Address address = cont.addAddress("BUS1").setCity(paramCity).setState("TX");

 

//create new contact

Contact createdContact = contactService.create(cont);

}

}