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