I'm using the Android SDK, Chat functionalities, currently I'm able to create a new Contact, Case and link those two. How can I link the created Contact/Case to an existing account?
The following code is capable to create a new Case, but it is not making the link with the Account.
// Account
val accountEntity = ChatEntity.Builder()
.showOnCreate(true)
.linkToTranscriptField("Account")
.addChatEntityField(
ChatEntityField.Builder()
.doFind(true)
.isExactMatch(true)
.doCreate(false)
.build("AccountNumber", erpCustomerNumber))
.build("Account")
// Map Subject to a field in a Case record
val caseEntity = ChatEntity.Builder()
.showOnCreate(true)
.linkToTranscriptField("Case")
.linkToAnotherSalesforceObject(accountEntity, "AccountId")
.addChatEntityField(
ChatEntityField.Builder()
.doFind(true)
.isExactMatch(true)
.doCreate(true)
.build("Subject", subject))
.build("Case")
The following code is capable to link the Contact with the Case:
val contactEntity = ChatEntity.Builder()
.showOnCreate(true)
.linkToTranscriptField("Contact")
.linkToAnotherSalesforceObject(caseEntity, "ContactId")
.addChatEntityField(firstNameField)
.addChatEntityField(lastNameField)
.addChatEntityField(emailField)
.addChatEntityField(descriptionField)
.build("Contact")