Usage Examples

Basic Lookup Automation Workflow

The following Deluge code will populate the City, State, Zip and Country on a Contact's mailing address only if there are no values in those fields.  This example is how the built-in Workflows are coded out of the box.

In this example there is a workflow that runs every time the mailing zip code is changed that then executes a function that calls the lookupAndParsePostalCode function.

This does not resolve distances to a user specified set of locations.

Deluge Code

// Record type and ID passed from the workflow into a custom automation function

void lookupContactZipChanged(String recordType, Int recordId, String postalCode) {

	fields = Map();
	fields.put("Mailing_City","base_city");
	fields.put("Mailing_State","base_state_province");
	fields.put("Mailing_Zip","base_postal_zip");
	fields.put("Mailing_Country","country_name");
	
	conditions = Map();
	conditions.put("Mailing_City","onlyifempty");
	conditions.put("Mailing_State","onlyifempty");
	conditions.put("Mailing_Country","onlyifempty");
	
	addressautoresolver.lookupAndParsePostalCode(recordType,recordId,postalCode,fields,conditions,null);
	
}

Workflow


© Eagle. All rights reserved.