+1 vote
in Rock by TinaStephens (8.6k points)
edited

Sun Valley added a Dynamic Data Block to show the reason a profile was inactivated. It is not showing the reason. This profile is an example https://rock.sv.cc/Person/26241 The Query is:

SELECT [ReviewReasonNote]

FROM [Person]

WHERE [Id] = @PersonId

AND [RecordStatusValueId] = 4

The lava is:

{% for row in rows %}
    <div class='alert alert-warning'>
        <strong>Inactivated Reason:</strong><br/>
        <i>"{{ row.ReviewReasonNote }}"</i>
    </div>
{% endfor %}

Is the "ReviewReasonNote" key wrong? Not sure how to find the right one.

1 Answer

+1 vote
by (13.1k points)
edited
 
Best answer

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 %}
Welcome! Here you can ask questions and receive answers (hopefully) from other members of our team.
...