-
Notifications
You must be signed in to change notification settings - Fork 8
Example: Create a contact salutation template
In this example I'm going to show you how to use XTL for easily generating a salutation for all of your contacts.
Download the latest XTL salutation from the release page and install it to your organization. Currently the release solutions only target CRM v9, but the code supports CRM v8 as well. I'll just need an CRM v8 organization for creating the appropriate solution, this will be done soon.
Open the solution and go to the configuration page.
Click on "Create New" and select contact as entity and create as message.
Target Field: salutation
Execution Criteria: IsEqual ( Value ("oss_languageid.oss_isocode"), "de-DE" )
Template: ${{If ( IsEqual ( Value ( "gendercode" ), 1 ), "Sehr geehrter Herr ", "Sehr geehrte Frau ")}} ${{Value("lastname")}}
Obviously, the oss_languageid field is a custom attribute of my test environment. It is a lookup, the "." seperator jumps to the record that is connected and retrieves the property after the dot. You can use an option set value as well, just as the gendercode inside the template.
Click "Entity" and select contact. Afterwards click "Select Target" and select a contact for testing. Click on preview and inspect the results.
Save the step by clicking "Update SDK Step". The logic is now functional in your system. Try creating a contact, the salutation will be generated. You should create an identical step for the update message of contacts and select first name, last name, gender code and language as trigger fields. When creating a new contact with german as language, the name will now be regenerated. By changing the execution criteria code to some other language code, you can now also generate new steps for other languages.