Originally posted by Unknown
To get the reason and/or the reason note, you will want to look at getting the RecordStatusReasonValueId (which is the dropdown) and the InactiveReasonNote. Since RecordStatusReasonValueId is a defined value, I also joined the defined value table.
SELECT V.[Value] AS [Reason], P.InactiveReasonNote
FROM [Person] p
LEFT JOIN DefinedValue V ON V.Id = P.RecordStatusReasonValueId
WHERE P.[Id] = @PersonId
AND [RecordStatusValueId] = 4
Here is the updated lava. I wasn't sure if you wanted the reason or the reason note so I added both:
{% for row in rows %}
<div class='alert alert-warning'>
<strong>Inactivated Reason:</strong><br/>
<i>"{{ row.Reason }} - {{ row.InactiveReasonNote }}"</i>
</div>
{% endfor %}