Skip to main content

UpdateSpecificRiskAssessmentIncludeMLROStage

public bool UpdateSpecificRiskAssessmentIncludeMLROStage(EntityReference specificRiskAssessment, string messageName, int mLROStageInclusion, int riskRating)
{
tracingService.Trace("Calling UpdateSpecificRiskAssessmentIncludeMLROStage");

// Determine if MLRO stage should be shown in KYC business process flow
bool newIncludeMLROStage;
if (messageName == "Create")
{
newIncludeMLROStage = (mLROStageInclusion == 206340001 /*Include*/);
}
else if (messageName == "Update")
{
newIncludeMLROStage = (mLROStageInclusion == 206340000 /*Risk routing*/ && riskRating == 206340001 /*Enhanced*/) || (mLROStageInclusion == 206340001 /*Include*/);

// TODO: refactor to a PreOperation step so we don't need to do a separate Update
Entity updateEntity = new Entity("tt_kyccheck", specificRiskAssessment.Id)
{
["tt_kycincludemlrostage"] = newIncludeMLROStage
};
crmService.Update(updateEntity);
}
else
{
throw new Exception("Unhandled message type.");
}

tracingService.Trace("Completed UpdateSpecificRiskAssessmentIncludeMLROStage");

return newIncludeMLROStage;
}