Professional Documents
Culture Documents
WorkspacePlug-inForSalesforceDevelopersGuide v2.1.6.0
WorkspacePlug-inForSalesforceDevelopersGuide v2.1.6.0
Developers Guide
v2.1.6.0
NOTICE
Phone: 1-888-GENESYS
Fax: 1-650-466-1260
The information contained herein is proprietary and confidential and cannot be disclosed or duplicated without the prior written
consent of Genesys Telecommunications Laboratories, Inc.
You are responsible for the security of your system. Product administration to prevent unauthorized use is your responsibility. Your
system administrator should read all documents provided with this product to fully understand the features available that reduce
your risk of incurring charges for unlicensed use of Genesys products.
ABOUT GENESYS
Genesys is the world's leading provider of customer service and contact software - with more than 4,000 customers in 80 countries.
Drawing on its more than 20 years of customer service innovation and experience, Genesys is uniquely positioned to help
companies bring their people, insights and customer channels together to effectively drive today's customer conversation. Genesys
software directs more than 100 million interactions every day, maximizing the value of customer engagement and differentiating the
experience by driving personalization and multi-channel customer service - and extending customer service across the enterprise to
optimize processes and the performance of customer-facing employees. Go to www.genesys.com for more information.
TRADEMARKS
Genesys and the Genesys logo are registered trademarks of Genesys Telecommunications Laboratories, Inc. All other company
names and logos may be trademarks or registered trademarks of their respective holders.
Table of Contents
1 Introduction ......................................................................................................... 4
1.1 About the Workspace Plug-in for Salesforce ...................................................................... 4
1.2 How the Software Works .................................................................................................... 5
1.2.1 Classic/Console Model .......................................................................................... 6
1.2.2 Lightning Model ...................................................................................................... 8
2 Documentation................................................................................................... 10
2.1 Salesforce Developer Documentation .............................................................................. 10
2.2 Genesys Technical Documentation .................................................................................. 10
3 Communication .................................................................................................. 11
3.1 Communication Protocol Between Workspace and Salesforce ....................................... 11
3.2 Communication Method Within Salesforce ....................................................................... 11
3.2.1 [action] Request Template ................................................................................... 11
3.2.2 AttachData Request ............................................................................................. 12
3.3 Messaging ......................................................................................................................... 13
3.3.1 Messages from Salesforce to WDE ..................................................................... 13
3.3.2 Messages from WDE to Salesforce ..................................................................... 14
3.4 Messaging Sequence ....................................................................................................... 17
3.4.1 Login .................................................................................................................... 17
3.4.2 Interaction Handling ............................................................................................. 18
4 Features ............................................................................................................. 19
4.1 Screen Pop ....................................................................................................................... 19
4.1.1 Voice Inbound ...................................................................................................... 19
4.1.2 Voice Outbound ................................................................................................... 19
4.1.3 Email .................................................................................................................... 19
4.1.4 Chat ...................................................................................................................... 19
4.1.5 Work Item ............................................................................................................. 19
4.1.6 SMS ..................................................................................................................... 20
4.1.7 Web Callback ....................................................................................................... 20
4.1.8 Open Media.......................................................................................................... 20
4.1.9 Social ................................................................................................................... 20
4.2 Data Display ...................................................................................................................... 21
4.3 Search Capability .............................................................................................................. 21
4.4 Activity Creation ................................................................................................................ 22
4.5 Logging ............................................................................................................................. 23
4.6 Mark Done from Salesforce .............................................................................................. 24
4.6.1 WDE Configuration .............................................................................................. 24
4.6.2 Salesforce Configuration ...................................................................................... 25
4.7 Browser Storage ............................................................................................................... 32
5 Customizing Salesforce ..................................................................................... 32
5.1 Classic/Console Mode ...................................................................................................... 32
5.2 Lightning Mode.................................................................................................................. 33
5.3 Custom Message from Workspace to Salesforce............................................................. 33
6 Debugging in a Browser ..................................................................................... 33
7 Packaging .......................................................................................................... 34
7.1 Using Change Sets to Deploy Code ................................................................................. 34
7.2 Using Ant to Deploy Code ................................................................................................. 34
1 Introduction
This document is for software developers interested in customizing the behavior of how the Workspace
Plug-in functions within Salesforce.com Service or Sales Cloud solutions operating in either Classic or
Console modes.
The content of the document is technical and contains terms and procedures that should be familiar to
Salesforce and web Developers. It is strongly recommended that those attempting to work with the Plug-
in are familiar with Salesforce.com development, administration and have a reasonable understanding of
contact/call center agent operations especially those supported by the Genesys Interaction Workspace
and Workspace Desktop Edition (WDE) products.
Please note, the Plug-in is only for use with the workstation installed Workspace product and not
Workspace.Web Edition (WWE).
Due to customer demand, Genesys Professional Services purposely provide the Salesforce components
of the Plug-in as a Salesforce Unmanaged Package allowing their customers to modify the internal
scripts. Typical modifications may include:
It is important to note that not all the Plug-in is ‘open’ to customer modification. Modifications to the
(Interaction) Workspace Desktop Edition code to add special handling characteristics can only be
performed by contract with Genesys Professional Services. The Workspace components are only
supplied as compiled Dynamic Link Libraries (DLL’s).
There are several techniques for how code development with Salesforce Visualforce, APEX and trigger
code scripts can be performed. Genesys recommends that Developers use the Salesforce Force IDE
plug-in to Eclipse. More information on the Force IDE method can be found at:
https://developer.salesforce.com/page/Force.com_IDE
A statement on upgrades. From time to time either through maintenance or software feature updates, an
upgrade may be requested from Genesys. Genesys Professional Services reserve the right to modify the
core code within the Plug-in to repair defects or add features. If an implemented version of the Plug-in
has been modified, re-introduction of those modifications will be necessary and Genesys Professional
Services cannot guarantee how those modifications used the code sequencing in the Plug-in shall remain
consistent. All modifications to the Workspace Plug-in for Salesforce code are performed at risk and
therefore it is recommended that Genesys-code modifications are kept to a minimum and large code
processing is moved to alternative scripts.
The software is designed to automate interaction handling between the Genesys Workspace and
Salesforce.com. Information from an IVR, external systems or routing strategies can be used by
Salesforce to screen pop records or create tasks. The features are bi-directional, so operations in
Salesforce can drive actions in Genesys Workspace such as dialing a number or adding new data
elements to an existing interaction.
The Workspace Plug-in for Salesforce supports most media channels of the Workspace product
including:
• Inbound Voice
• Outbound Voice (predictive, progressive and preview modes)
• Genesys email
• Genesys web chat
• SMS
• iWD tasks
• Social Engagement
Genesys Professional Services perform customer development on the Plug-in and therefore do test
functionality as new versions of Salesforce are released (3 per year – Spring, Summer and Winter).
Like Salesforce, the browsers supported by the Workspace Plug-in for Salesforce include Chrome,
Internet Explorer and Firefox but only on the Windows platform since Genesys Workspace is a .NET
application. There is no recommendation which browser the developer should use and the selection tends
to be a developer selection.
It is of value for the developer to understand the high-level concept of how the Plug-in functions to
support their design interests. The following diagram represents the architecture of the Plug-In.
The Genesys Workspace is customized to implement an HTTP Listener that also supports TLS 1.1
protocol. Interaction behaviors are also customized to send state change and supporting data to HTTP
requests that are waiting against the listener. These waiting HTTP requests are sent from an Open CTI
implementation of the Plug-in within Salesforce installed via the Workspace Plug-in unmanaged package
as described in the Plug-in’ Deployment Guide. Therefore, you can consider that Salesforce is polling the
Workspace software looking for work to be performed. This poll operation is a long-poll and will return
immediately to Salesforce to trigger an action on state change receipt by the HTTP listener. Polling
between Salesforce and Workspace is performed within the user workstation between the Salesforce
browser and the Workspace software, no communication leaves the workstation in support of this
operation.
At the same time, if there is a Salesforce request such as a click-to-dial, these are sent as supplemental
messages to Workspace and received by the HTTP listener and processed immediately.
Information exchanged between Workspace and Salesforce or vice-versa is in JSON format and where
appropriate includes all the attached data (key-value pairs) of the interaction. Note all interaction
attributes are sent to Salesforce. Please see the related information for each message type for the data
properties communications. Each message contains an ‘action’ attribute which is used by the receiving
code to dispatch to the function in support of its handling.
From the perspective of the JavaScript code model implemented within Salesforce, the representation of
this handling for Classic/Console is as follows:
Supporting the operation of the Plug-in are APEX classes and Visualforce pages. These are as follows:
Each APEX class has a corresponding Test Class. Any updates to an APEX class may require an update
to the corresponding Test Class. Salesforce requires 75% code coverage before a package can be built.
A call center definition file specifies a set of fields and values that are used to define a call center
in Salesforce. The Plug-in uses this to define information needed for operation. Users will need to be
assigned to this Call Center to access the Plug-in.
Importing the Call Center xml for Classic/Console yields the following results:
sforce.interaction.cti.getCallCenterSettings
The JavaScript code model implemented within Salesforce for Lightning is as follows:
Supporting the operation of the Plug-in are APEX classes and Visualforce pages. These are as follows:
Like Classic/Console modes, each APEX class has a corresponding Test Class. Any updates to an APEX
class may require an update to the corresponding Test Class. Salesforce requires 75% code coverage
before a package can be built.
In Lightning mode, as well, a call center definition file specifies a set of fields and values that are used to
define a call center in Salesforce. The Plug-in uses this to define information needed for operation. Users
will need to be assigned to this Call Center to access the Plug-in.
Importing the Call Center xml for Lightning yields the following results:
sforce.opencti.getCallCenterSettings
2 Documentation
The following documentation references may be useful for specific development requirements
These documents are released consistent with Salesforce releases, therefore it is best to perform a web
search for the latest versions.
• Open CTI Developer’s Guide – Provides API definitions and examples for CTI functionality in
Salesforce that are used in the Plug-in.
• Salesforce Console Integration Toolkit Developer’s Guide - Provides API definitions for
Console manipulations used in the Plug-in.
• Soap API Developer’s Guide – The Standard Objects section provides a list of standard objects
and their standard fields.
3 Communication
The Plug-in is expecting an action request using JSON string in the following format:
Where
• action is the action to be performed
• key is the data key and value is the data value
• If the action will be done in relation to a specific active interaction, then one of the key
must be “id” and the value must be the interaction id
• Any number of key/value pairs may be present
sforce.console.addEventListener('CTIEvent', receiveSFMessage);
This section specifically provides the communication when a Visual Force page requests to attach data to
an active Genesys interaction. The Plug-in is expecting a JSON string in the following format:
Where
• KVP key is the attached data key and KVP value is the attached data value
• One of the KVP key must be “id” and the KVP value must be the interaction id to attach
the data to
• Any number of key/value pairs may be present
Example:
{"action":"AttachData","actionData":{"sfdcObjectType":"Contact","id":"0371D42J52U02006"}}
ctiMessageAsJSON =
‘{"action":"AttachData","actionData":{"sfdcObjectType":"Contact","id":"0371D42J52U02006"}}‘;
sforce.console.fireEvent('CTIEvent', ctiMessageAsJSON, function (result) {
console.log("CTIEvent fired result: " + result); });
With Classic mode, currently, Salesforce has not applied an ID to the iframe and therefore it cannot be
found under usual JavaScript element location techniques. Therefore, it is not possible to use
postMessage() javascript inter-frame messaging techniques to communicate from a Salesforce record
page to the plug-in. As a replacement, session storage can be used for storing and accessing data.
3.3 Messaging
There are two types of messages that Salesforce will send to Workspace – either a “poll” message or a
“request” message. All messages are in JSON format.
Request messages going from Salesforce to Workspace will contain the followings:
3.3.1.2.1 AttachData
Request message from Salesforce to Workspace to attach data contained within “actionData” to the
interaction identified by “id”.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"010A027
D61D4A004"}}&_=1457294838456
3.3.1.2.2 ConnectionRequest
Request message from Salesforce to Workspace to establish a connection when Salesforce Plug-in is
initiated. PollInterval is a Call Center field (Poll Queue Timeout) that tells Workspace how long Salesforce
waits before sending a poll message after Salesforce receives any message from Workspace. It is used
to determine when that connection can be deemed as no longer active and a new connection can be
accepted.
This message is sent at a specified interval in a Call Center field (Request Timeout) until Workspace will
respond with either a ConnectionAccepted or ConnectionDenied.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838164&/request={"action":
"ConnectionRequest","actionData":{},"pollInterval":"100","CI":"1457294838170a"}&_=1457294838165
3.3.1.2.3 Dial
Request message from Salesforce to Workspace when Click-to-Dial functionality is used within
Salesforce. This causes an outgoing call to be initiated.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"Dial","CI":"1457294838170a","actionData":{"number":"5115","sfdcObjectId":"00QF000000aCp65"}}&_=14
57294838875
3.3.1.2.4 GetData
Request message from Salesforce to Workspace to retrieve specific Genesys Configuration data as
specified by “data”. This message is sent after a ConnectionAccepted message is received from
Workspace.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838164&/request={"action":
"GetData","CI":"1457294838170a","actionData":{"data":"data-display-attribute"}}&_=1457294838166
3.3.1.2.5 RequestAttachment
Request message from Salesforce to Workspace to get email attachment(s) as specified in the
CreateActivity request from Workspace. For each attachment, a separate RequestAttachment is sent.
https://127.0.0.1:5050/?callback=jQuery1102019485390395857394_1457294838455&/request={"action":
"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"010A027
D61D4A004"}}&_=1457294838456
3.3.1.2.6 FocusChanged
Request message from Salesforce to Workspace to on focus change. Response from Workspace is the
actual data of the attachment.
{"action":"FocusChanged","CI":"1497629959403a","actionData":{"sfdcObjectId":"00T6A000004mrJr"}}
o PerformSFDCRequest
3.3.2.1 Complete
Response Message from WDE to Salesforce at the completion of actions such as AttachData or Dial from
Salesforce,
jQuery110205944839925505221_1413475948820({"action":"Complete"})
3.3.2.2 ConnectionAccepted
Response Message from WDE to Salesforce for ConnectionRequest action if connection is established.
jQuery1102019485390395857394_1457294838164
({"action":"ConnectionAccepted","CI":"1457294838170a","monitorSFDCSession":"true"})
3.3.2.3 ConnectionDenied
Response Message from WDE to Salesforce for ConnectionRequest action if connection request fails.
jQuery1102019485390395857394_1457294838164
({"action":"ConnectionDenied","CI":"1457294838170a"})
3.3.2.4 CreateActivity
Message from Workspace to Salesforce sent to create an activity of type Task when the Interaction is
accepted or marked done. If the activity is created at accept, a second CreateActivity request will be sent
at marked done to update the existing activity with the latest information. All user data is sent in
“userData”.
jQuery110205944839925505221_1413475948820({"action":"CreateActivity","id":"010A02535DC79007","
source":"5115","destination":"8207","OtherDN":"5115","type":"Voice","Media_Type":"Voice","calltype":"Inb
ound","notes":"","epochTime":0,"reason":"MarkedDone","dispositionCode":"","duration":"00:07:04.326000
0","userData":{"ServiceType":"default","ServiceObjective":"","PegAG?:Customer_Service
>10":1,"ContactId":"0008Va76MGEC000Q","sfdcObjectId":"003o0000005iPGuAAM","id":"010A02535DC7
9007"}})
3.3.2.5 DataRetrieved
Response Message from WDE to Salesforce for GetData action:
Response from Workspace is:
jQuery110205944839925505221_1413475948820({"action":"DataRetrieved","CI":"1413475948740a","acti
onData":{"autoOpen":"true","data-display-attribute": [{"Name":"CONTACT_ID","DisplayName":"CONTACT
ID","order":"1"},{"Name":"FirstName","DisplayName":"First Name","order":"1"}]}})
3.3.2.6 NoWork
Message from Workspace to Salesforce when there is no message in the queue:
jQuery1102019485390395857394_1457294838164({"action":"NoWork"})
3.3.2.7 OpenObject
Message from Workspace to Salesforce sent when the Interaction is accepted. All user data is sent in
“userData”.
jQuery110205944839925505221_1413475948736({"action":"OpenObject","id":"010A02535DC79007","so
urce":"5115","destination":"8207","OtherDN":"5115","type":"Voice","calltype":"Inbound","role":"RoleDestina
tion","epochTime":0,"reason":"Established","userData":{"ServiceType":"default","ServiceObjective":"","Peg
AG?:Customer_Service >10":1,"ContactId":"0008Va76MGEC000Q"}})
3.3.2.8 PerformSFDCRequest
Message from Workspace to Salesforce sent when a custom request needs to be sent. This method
takes one parameter that must be in a JSON format. Workspace will take that parameter and construct a
request to send to the Salesforce Plug-in.
See Section “Custom Message from Workspace to Salesforce” for details.
3.4.1 Login
The diagram below displays the login sequence. Request messages are shown in green.
Login to workspace
Create HTTP(S) listener
ConnectionRequest Login to Salesforce
ConnectionAccepted
GetData
DataRetrieved
poll
If msg queue is empty respond
with NoWork msg after sfdc- NoWork
connector.poll-queue-timeout Send next poll after Poll Queue
Timeout (in Call Center definition)
poll
NoWork
:
: Repeat “poll”/”NoWork” cycle
The diagram below shows an interaction handling sequence. Request messages are shown in green.
Workspace Salesforce
:
:
poll
Interaction arrives and is accepted
OpenObject msg put in queue and OpenObject
sent Perform Screen pop
Request to attach salesforce
AttachData object Id
poll
NoWork
:
:
poll
Interaction mark done
CreateActivity msg put in queue
and sent CreateActivity
Perform Activity Creation
poll
NoWork
:
:
4 Features
If steps 1 or 2 fail to provide a match, then the custom Case Search Visualforce page is screen popped. If
steps 3, 4 or 5 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
4.1.3 Email
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.email-sfdc-field”
and “sfdc-connector.email-sfdc-field-value” attached data is present
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
4.1.4 Chat
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.chat-sfdc-field”
and “sfdc-connector.chat-sfdc-field-value” attached data is present
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
4.1.6 SMS
1. Salesforce object id – executed when “sfdcObjectId” attached data is present (usually used
for consult/transfer/conference)
2. Custom search of Account, Contact, Lead – executed when “sfdc-connector.sms-sfdc-field”
and “sfdc-connector.sns-sfdc-field-value” attached data is present
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
If steps 1 or 2 fail to provide a match or provides multiple matches, then the custom Search Visualforce
page is screen popped.
4.1.9 Social
This is not yet supported.
There are two custom Visual Force “lookup” pages that perform a search within Salesforce. They are
invoked with the following URLs:
Classic/Console:
apex/g_CustomLookup?lksrch=searchField&ixnId=ixnId&inServiceCloudConsole=value
apex/g_CustomCaseLookup?lksrch=searchField&ixnId=ixnId&inServiceCloudConsole=value
Lightning Experience:
apex/gl_CustomLookup?lksrch=searchField&ixnId=ixnId
apex/gl_CustomCaseLookup?lksrch=searchField&ixnId=ixnId
In each case, once the User selects an object from the “lookup” page, a message is sent to the Plug-in
using sforce.console.fireEvent with ‘CTIEvent’. The message is a JSON string as follows:
The Plug-in will take the above message and send this message to Workspace:
{"sfdcObjectId":"salesforceId","id":"interactionId"}
{"action":"AttachData","CI":"1457294838170a","actionData":{"sfdcObjectId":"500F000000YwTd4IAF","id":"
010A027D61D4A004"}}
• Voice
• Email
• Chat
• InteractionWorkItem
• Sms
• Webcallback
4.5 Logging
The Plug-in provides logging functionality within the display. The log file can also be downloaded.
To enable Mark Done we need to do configuration changes for Activity to be created at time of voice
release instead of at Mark Done. The following WDE configuration is provided to do this:
The following code behind the custom Mark Done button is required. “reason” is only processed by
Workspace if the above configuration sfdc-connector.use-sf-disposition-on-release is set to true.
4.6.2.1 Classic
This feature is currently not available in Classic
4.6.2.2 Console
The JSON string to use is:
{"action":"MarkDone","actionData": { reason":"disposition,"description":"notes"}}
An example of using this message would be to put a custom button on the Activity page.
Note: After Salesforce Spring 17 release, With Classic, Salesforce have not applied an ID to the iframe
and therefore it cannot be found under usual JavaScript element location techniques. As the iframe
cannot be located, it is not possible to use postMessage() javascript inter-frame messaging techniques to
communicate from a Salesforce record page to the plug-in. This document will be updated as new
solution provided by Salesforce. Therefore, this feature is currently not provided for Classic.
var message = {
action: 'MarkDone',
actionData: {
sfdcObjectType:"Task",
id:"{!Task.CallObject}",
reason:"{!Task.CallDisposition}",
description:"{!Task.Description}"
}
};
if (sforce.console.isInConsole()) {
sforce.console.fireEvent('CTIEvent', ctiMessageAsJSON);
}
4.6.2.3 Lightning
An example of using this message would be to put an Action Link on the Activity page.
An example of How to create Action link in lightening using the Lightning Mark Done Component.
1. Need to select the Button, links, and Action of Task object from Object Manager and create New
Action as below mentioned.
Update the page layout of Task and add the Mark Done button from the salesforce1 & Lightning
Experience and drag and drop into Lightning section and save the layout.
You can create Lightning component using new Lightning Bundle option and follow the wizard as
below.
In the project explorer, you can see the tree structure of the resources as below.
To Get started with lightning component development using developer console, need to select the New
Lightning Bundle from File menu as below.
For security purposes, Lightning components now require you to define a custom Salesforce domain
name for your organization.
And if you don’t have My Domain enabled for your organization, your Lightning components will be
disabled when your organization is upgraded to Winter ’16.
Reference :
https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_lightning_cruc.htm
Provide unique domain name and check for availability then register the domain.
After registration, you will get an email for notification to verify the registration process.
Close existing salesforce session and login with the new domain specific salesforce URL and navigate to
My Domain for further action where we need to deploy the domain to all user by click of Deploy to Users.
Now with this screen we are ready to go with the lightning component of My Domain enablement.
Also available is window.localStorage although the Plug-in currently does not use it.
5 Customizing Salesforce
Most customizations will just require the user to update the code in g_default_js to perform specific tasks.
It may be desirable to rename g_default_js from its generic name to a more specialized name.
g_version_js should be updated to include the specific version for the customization.
Most customizations will just require the user to update the code in gl_default_js to perform specific tasks.
It may be desirable to rename gl_default_js from its generic name to a more specialized name.
gl_version_js should be updated to include the specific version for the customization.
The user must then add code to the g_default_s javascript file in Classic/Console or gl_default_s
javascript in Lightning mode to process the request.
6 Debugging in a Browser
To view logs from the Apex classes in Developer Console (Browser Independent):
• Click the drop down under your user name
• Click on “Developer Console”
• Click on the log you wish to view from the “Logs” tab
7 Packaging
If a Salesforce package is used for load delivery, keep in mind that Salesforce automatically pulls in all
custom data that is referenced by the APEX classes. This may cause an error when trying to import this
package because.
If not using ForceIDE, it may be preferred to use ANT to deploy code, the following describes the steps to
perform this process.
The zip file that is used in the above package is created by running the command “ant build” from the src
directory of the project and would use a simple build.xml like the one below to copy the contents of the src
directory to a zip file.
<target name="build">
<delete file="..\..\Package\Salesforce Components\Package
Alternative\${ant.project.name}.zip" />
<zip destfile="..\..\Package\Salesforce Components\Package
Alternative\${ant.project.name}.zip"
update="true"
basedir="."
excludes="build.xml"
/>
</target>
</project>
The above package requires that the customer already have all the custom objects and fields that are
referenced by the code. You can either modify the above build.xml file to produce that information for
clean test environments, or create a very simple script to collect this information from an existing
environment and build a package to add any missing custom objects/fields.
Using the command “ant retrievePkg” and following build.xml file you can retrieve the contents of a
package, edit the package.xml and use it to deploy any custom objects you need for a clean environment.
<target name="retrievePkg">
<mkdir dir="retrieveOutput"/>
<sf:retrieve username="${sf.username}" password="${sf.password}"
serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" retrieveTarget="retrieveOutput"
packageNames="${sf.pkgName}"/>
</target>
</project>