사례 할당 규칙을 사용하면 사례를 적절한 사용자 또는 대기열로 자동 라우팅할 수 있습니다. 사례 할당 규칙은 사례 할당을 위한 조건과 순서를 정의하는 여러 규칙 항목으로 구성됩니다. 여러 규칙(예: 표준 규칙 및 휴일 규칙)을 만들 수 있지만 한 번에 하나의 규칙만 “활성” 상태가 될 수 있습니다.
표준 UI에서 사용자는 옵션 섹션에서 “활성 할당 규칙을 사용하여 할당” 확인란을 선택하면 할당 규칙을 트리거할 수 있습니다. 앱이 Apex에서 사례를 삽입해야 하고 할당 규칙을 트리거할 경우 문제가 발생합니다. 이 스크립트를 사용하면 사례가 삽입되지만 사례에 “활성 할당 규칙을 사용하여 할당” 필드가 없으므로 할당 규칙이 트리거되지 않습니다.
//Instance of case Case newCase = new Case(Status = 'New') ; //Inserting a Case insert newCase ;
Apex에서 사례 할당 규칙 실행
솔루션은 Database.DMLOptions를 사용하고 있습니다. Database.DMLOptions 클래스는 트랜잭션 중에 추가 정보를 제공할 수 있습니다. 예를 들어 필드 또는 할당 규칙 정보의 자르기 동작을 지정합니다. 예를 들어 아래 스크립트는 사례의 할당 규칙을 가져온 다음 “활성 할당 규칙을 사용하여 할당” 확인란에 대한 DMLOptions를 생성합니다.
//Fetching the assignment rules on case AssignmentRule AR = new AssignmentRule(); AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1]; //Creating the DMLOptions for "Assign using active assignment rules" checkbox Database.DMLOptions dmlOpts = new Database.DMLOptions(); dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id; Case newCase = new Case(Status = 'New') ; //Setting the DMLOption on Case instance newCase.setOptions(dmlOpts); insert newCase ;
이제 이 스크립트를 사용하여 사례를 삽입하면 할당 규칙이 트리거됩니다.
000387623

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.