PlatformApplicable to all products in Temenos Journey Manager. | All Personas | All versions This feature is related to all versions.
You can configure a prefill generator against a particular Manager form in Salesforce by following this process:
TransactPrefillGenerator
, which allows you to provide JSON configuration to control which fields are included in the prefill generation.Sample SObject Id
that allows you to generate a Sample Prefill XML
value and test your configuration.
The SObject Id
for a Salesforce object can be obtained from the URL while viewing that object.
Sample SObject Id
). The generated prefill XML data will be added to the Sample Prefill XML field, if your configuration is correct.
Currently the Generate Sample button is not visible in Salesforce Lightening, so you must switch to Classic mode to have it displayed.
Where you need to perform different prefill generation between multiple versions of a form you may append an array of versions to the form code attribute to target specific versions. For example, you may wish to have 2 separate prefill generators, one for the first version of the form and another for subsequent versions. This will allow you to configure the prefill generation for new form versions prior to activation of those versions.
To utilize this feature you must specify the specific version numbers as an array directly after the form code. Some samples assuming a form code of 'my-form':
This section describes the syntax and supported directives of the JSON configuration consumed by the TransactPrefillGenerator class. This article assumes knowledge of JSON formatting. The JSON configuration should conform to the following structure:
{
"parameters":{
"<param-name>": "<param-value>"
},
"sobjects":{
"<object-type-name>": {
"includeFields": ["<field-name>", ... ],
"includeRelated": ["<relationship-name>", ... ],
"includeCustom": {"<custom-label>": "<custom-value>", ... }
},
...
}
}
The following example configuration illustrates all supported directives:
{
"parameters":{
"rootElementName": "SalesforceData"
},
"sobjects":{
"Contact": {
"includeFields":["Id","FirstName","LastName","Email","Phone","Title"],
"includeRelated":["Account"],
"includeCustom":{"FullName": "{!FirstName} {!LastName}"}
},
"Account": {
"includeFields":["Name","Type","Industry"],
"includeRelated":["Owner","Opportunities"]
},
"Opportunity": {
"includeFields":["Name","Amount"]
},
"User": {
"includeFields":["Name","Email","Username","Manager.Name"]
}
}
}
rootElementName - The name to be given to the root element in the generated XML prefill data. Defaults to SFDCPrefillData. This is the optional parameter.
A single JSON configuration can support any number of Salesforce object types, thereby allowing the form to be prefilled with many different object types. For example, the same form may be prefilled from a contact record or a lead record.
The configuration for an object type must be contained in an attribute labeled with the name of that object type. Note the configuration below for the Account object:
"Account": {
"includeFields":["Name","Type","Industry"]
}
If you wish to prefill data from Salesforce that is contained in complex types (e.g. Addresses), you should configure the individual data sub-attributes in your prefill configuration. For example, if you want to prefill the Shipping Address from the Account object, your configuration should be similar to this:
{
"sobjects":{
"Account": {
"includeFields":["Name","ShippingStreet","ShippingCity","ShippingState","ShippingPostalCode","ShippingCountry"]
}
}
}
The includeFields directive is required for all object prefill definitions and allows you to explicitly specify the fields to be included in the prefill data with the following considerations:
The includeRelated directive is optional and allows you to specify related objects to include in the prefill data with the following considerations:
The TransactPrefillGenerator interprets the JSON configuration and generates the XML data used to prefill the form according to the following rules:
<Owner>
<Name>Jeff Johnson</Name>
<Manager>
<Name>Jenny Quack</Name>
</Manager>
</Owner>
<Opportunities>
<Opportunity>
<Name>Chicago City Store Displays</Name>
<Amount>$50,000.00</Amount>
</Opportunity>
<Opportunity>
<Name>San Francisco Mobile Signage</Name>
<Amount>$28,000.00</Amount>
</Opportunity>
</Opportunities>
The following block illustrates an example of the XML prefill data produced by the generation engine:
<?xml version="1.0" encoding="UTF-8"?>
<SFDCPrefillData>
<Contact>
<Id>00390000015C9LBAA0</Id>
<FirstName>Kristen</FirstName>
<LastName>Akin</LastName>
<Title>Director, Warehouse Mgmt</Title>
<Phone>(434) 555-3100</Phone>
<Email>[email protected]</Email>
<FullName>Kristen Akin</FullName>
</Contact>
<Account>
<Name>Volley Music</Name>
<Type>Customer - Direct</Type>
<Industry>Retail</Industry>
</Account>
<Owner>
<Name>Jeff Johnson</Name>
<Email>[email protected]</Email>
<Username>[email protected]</Username>
<Manager>
<Name>Jenny Quack</Name>
</Manager>
</Owner>
<Opportunities>
<Opportunity>
<Name>Chicago City Store Displays</Name>
<Amount>$50,000.00</Amount>
</Opportunity>
<Opportunity>
<Name>San Francisco Mobile Signage</Name>
<Amount>$28,000.00</Amount>
</Opportunity>
</Opportunities>
<User>
<Name>Johny Lighning</Name>
<Email>[email protected]</Email>
<Username>[email protected]</Username>
<Manager>
<Name>Jack Sparrow</Name>
</Manager>
</User>
</SFDCPrefillData>
Where the default prefill generator does not provide the level of control required, you may define your own prefill generator by developing an APEX class that implements the ITransactPrefillGenerator interface. To utilize your custom prefill generator, simply specify the class name in the relevant Prefill Generator record and any configuration required by the class.
global interface ITransactPrefillGenerator {
/**
* This function generates the prefill XML data based on the config provided.
*
* @param prefillObjectId The Id of the object to use for prefill generation
* @param formPrefillConfig The string containing the generation config
* @return The generated prefill XML data
*/
String generatePrefillXml(Id entityId, String config);
}
Next, learn how to configure the Transact for Salesforce App UI in Salesforce