From f3a3d23cf9b6ef7a93fdd55f98be15c29896aa74 Mon Sep 17 00:00:00 2001 From: James Gunn Date: Fri, 19 Apr 2024 10:22:48 +0100 Subject: [PATCH] Use the contact ID returned from CRM (#1290) --- .../Dqt/DataverseAdapter.CreateTeacher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/DataverseAdapter.CreateTeacher.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/DataverseAdapter.CreateTeacher.cs index b2935a5d4..e6fe8f7fc 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/DataverseAdapter.CreateTeacher.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/DataverseAdapter.CreateTeacher.cs @@ -94,8 +94,9 @@ public async Task CreateTeacher(CreateTeacherCommand comman } var txnResponse = (ExecuteTransactionResponse)await _service.ExecuteAsync(txnRequest); + var createdContactId = ((CreateResponse)txnResponse.Responses.First()).id; - return (CreateTeacherResult.Success(helper.TeacherId, trn), txnRequest); + return (CreateTeacherResult.Success(createdContactId, trn), txnRequest); } internal class CreateTeacherHelper