Cannot LinkToEntity more than one entity
Last updated 2016-07-28 ·Reference W-2541588 ·Reported By 6 users
LinkToEntity cannot be used more than once in the same prechat form to link more than one entity. For example, one can easily link a Contact to a Case, but one cannot link both a Contact and a custom object to a Case.
To ease setup, we'll use the somewhat arbitrary situation of linking both a Contact and a Lead to a Case. This saves the trouble of setting up a custom object (but note that the same problem occurs with custom objects)
Setup an org with Live Agent
Add a new custom field to the Case object: a lookup field to the Lead object
Create a Contact that will be linked to the Case
Create a Lead that will be linked to the Case (be sure to fill in the email address field)
Add a VF prechat form page that prompts for Contact email & Lead email, and use LinkToEntity to link them to a newly created Case. The test form to use will be attached.
Connect the prechat form to the chat button with the pre-chat form URL field
Copy & paste from the chat button code & deployment code to a html file to use as the chat initiator file
Use the chat initiator file to start the chat (you should do this from the same browser where you're logged into the org)
Fill in the fields, using the same email addresses as the Contact & Lead records created earlier
Note that the Contact gets linked to the Case that is created, but the Lead is not linked.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.