2016-11-10 1 views

답변

2

플러그인을 등록해야 메시지, 1 차 및 2 차 엔티티를 none으로 연결할 수 있습니다.

플러그인, 당신은 조건을 확인하기 위해 [ "관계는"(우리가 "systemuserroles_association"를 찾고 있습니다) context.MessageName ("준"또는 "해제")와 context.InputParameters를 확인하기 위해

코드가 필요

//all usual plugin stuff here 

if (context.InputParameters.Contains("Relationship")) { 
    relationshipName = context.InputParameters["Relationship"].ToString(); 
}         

// Check the “Relationship Name” with your intended one 
if (relationshipName != "systemuserroles_association") { 
    return; 
} 

if (context.MessageName == "Associate") { 
    //logic when role added 
} 
if (context.MessageName == "Disassociate") { 
    //logic when role removed 
} 
else { 
    //not interested 
} 

나는 코드를 컴파일하지 않았지만 진행 방법을 알려 주어야합니다.