CostPlanBatchOperations - 전역

  • 릴리스 버전: Xanadu
  • 업데이트 날짜 2024년 08월 01일
  • 읽기7분
  • CostPlanBatchOperations 스크립트 포함은 배치 처리를 사용하여 수요 및 프로젝트에 대한 많은 비용 계획 기록을 생성할 수 있는 메서드를 제공합니다. GlideRecord 대신 이 스크립트 포함을 사용하여 여러 비용 계획 기록을 보다 효율적으로 생성할 수 있습니다.

    CostPlanBatchOperations.add() 메서드를 사용하여 배치 대기열에 원하는 수의 비용 계획을 추가합니다. 필요한 모든 비용 계획을 추가한 후에는 CostPlanBatchOperations.process() 메서드를 사용하여 인스턴스에 비용 계획을 생성/삽입합니다. CostPlanBatchOperations.process() 메서드를 호출할 때까지 추가 요청은 배치 대기열에 남아 있습니다(아직 인스턴스에 추가되지 않음). 어떤 이유로든 배치 대기열에서 모든 비용 계획을 제거해야 하는 경우 CostPlanBatchOperations.clear() 메서드를 사용합니다.

    이 스크립트 포함을 사용하려면 PPM Standard(com.snc.financial_planning_pmo) 플러그인을 활성화해야 합니다.

    CostPlanBatchOperations - add(객체 costPlan)

    지정된 작업(프로젝트 또는 요구)에 하나 이상의 비용 계획을 추가합니다. 여러 비용 계획을 생성하려는 경우 이 방법을 사용합니다.

    처리가 완료되면 비용 계획이 지정된 프로젝트 또는 요구에 삽입됩니다. 그런 다음 인스턴스 내에서 보고 수정할 수 있습니다. 자세한 내용은 프로젝트 비용 계획 생성요구 비용 계획 생성을 참조하세요.
    주:
    이 메서드는 인스턴스에 추가할 비용 계획만 정의합니다. 비용 계획은 costPlanBatchOperations.process()가 호출될 때까지 인스턴스에 삽입되지 않습니다.
    표 1. 매개변수
    이름 유형 설명
    비용 계획 객체 기존 작업에 추가할 각 비용 계획을 설명하는 하나 이상의 객체 또는 객체 배열입니다.
    costPlan.name 문자열 비용 계획의 이름입니다.

    최대 길이: 130자

    costPlan.task 문자열 이 비용 계획과 연결할 프로젝트 또는 요구의 Sys_id입니다. 다음 테이블 중 하나에서 이 값을 찾을 수 있습니다.
    • 프로젝트 [pm_project]
    • 프로젝트 작업 [pm_project_task]
    • 요구 [dmn_demand]
    costPlan.unit_cost 번호 지정된 자원의 단일 단위에 대한 비용입니다.
    costPlan.resource_type 문자열 이 비용 계획과 연결된 비용 유형을 정의하는 기록의 Sys_id입니다. 이 매개변수에 사용할 수 있는 값은 비용 유형 정의 [resource_type_definition] 테이블에 정의되어 있습니다.
    costPlan.start_fiscal_period 문자열 이 비용 계획과 연결할 시작 회계 기간을 정의하는 기록의 Sys_id입니다. 이 매개변수에 사용할 수 있는 값은 회계 기간 [fiscal_period] 테이블에 정의되어 있습니다.
    costPlan.end_fiscal_period 문자열 이 비용 계획과 연결할 종료 회계 기간을 정의하는 기록의 Sys_id입니다. 이 매개변수에 사용할 수 있는 값은 회계 기간 [fiscal_period] 테이블에 정의되어 있습니다.
    costPlan.<선택 사항입니다> 다양 한 옵션입니다. 추가 매개변수를 전달하여 비용 계획에 추가할 수 있습니다. 사용 가능한 매개변수는 생성하는 비용 계획의 유형에 따라 다릅니다.

    전달할 수 있는 추가 매개변수 목록은 비용 계획 [cost_plan] 테이블을 참조하십시오.

    표 2. 반환
    유형 설명
    void

    이 예에서는 간단한 일괄 처리 비용 계획을 추가하는 방법을 보여줍니다.

    //Define Array of Cost Plan records in JSON format
    var costPlanRecords= [];
    costPlanRecords.push({
       name:'Capital Expense',
       task:'f7a36d1bdb58001025c85a35dc96193a', // sys_id of the task
       unit_cost:1000.00, //decimal 
       resource_type:'a546eaf79330120064f572edb67ffb70', // sys_id of the cost type definition
       start_fiscal_period:'091b6e60cb111200f2de77a4634c9c2e', // sys_id of the start fiscal period record 
       end_fiscal_period:'0d1b6e60cb111200f2de77a4634c9c2f',// sys_id of the end fiscal period record 
       quantity:1 // Optional cost plan record attributes
    });
     
    var costPlanBatchOperations = new CostPlanBatchOperations();
    costPlanBatchOperations.add(costPlanRecords);
    var costPlanSysIds = costPlanBatchOperations.process();
    
    

    CostPlanBatchOperations - clear()

    CostPlanBatchOperations.add() 메서드를 사용하여 추가된 모든 비용 계획 객체를 제거합니다.

    주:
    이 방법은 추가된 비용 계획에 대해서만 작동합니다. 비용 계획이 처리되면 이 방법으로 제거할 수 없습니다. 처리된 비용 계획은 UI를 통해 수동으로 제거해야 합니다.
    표 3. 매개변수
    이름 유형 설명
    없음
    표 4. 반환
    유형 설명
    void

    이 예에서는 비용 계획을 추가한 후 배치 큐를 지우는 방법을 보여줍니다.

    //Define Array of Cost Plan records in JSON format
    var costPlanRecords= [];
    costPlanRecords.push({
       name:'Capital Expense',
       task:'f7a36d1bdb58001025c85a35dc96193a', // sys_id of the task
       unit_cost:1000.00, //decimal 
       resource_type:'a546eaf79330120064f572edb67ffb70', // sys_id of the cost type definition
       start_fiscal_period:'091b6e60cb111200f2de77a4634c9c2e', // sys_id of the start fiscal period record 
       end_fiscal_period:'0d1b6e60cb111200f2de77a4634c9c2f',// sys_id of the end fiscal period record 
       quantity:1 // Optional cost plan record attributes
    });
     
    var costPlanBatchOperations = new CostPlanBatchOperations();
    costPlanBatchOperations.add(costPlanRecords);
    var costPlanSysIds = costPlanBatchOperations.process();
    costPlanBatchOperations.clear();

    CostPlanBatchOperations - process()

    CostPlanBatchOperations.add() 메서드를 사용하여 추가된 모든 비용 계획을 처리하고 해당 비용 계획 및 관련 롤업을 생성합니다.

    비용 계획이 성공적으로 처리되면 비용 계획 큐가 지워집니다.

    표 5. 매개변수
    이름 유형 설명
    없음
    표 6. 반환
    유형 설명
    배열 생성된 각 비용 계획의 시스템 ID입니다.

    이 예에서는 간단한 일괄 처리 비용 계획을 처리하는 방법을 보여줍니다.

    //Define Array of Cost Plan records in JSON format
    var costPlanRecords= [];
    costPlanRecords.push({
       name:'Capital Expense',
       task:'f7a36d1bdb58001025c85a35dc96193a', // sys_id of the task
       unit_cost:1000.00, //decimal 
       resource_type:'a546eaf79330120064f572edb67ffb70', // sys_id of the cost type definition
       start_fiscal_period:'091b6e60cb111200f2de77a4634c9c2e', // sys_id of the start fiscal period record 
       end_fiscal_period:'0d1b6e60cb111200f2de77a4634c9c2f',// sys_id of the end fiscal period record 
       quantity:1 // Optional cost plan record attributes
    });
     
    var costPlanBatchOperations = new CostPlanBatchOperations();
    costPlanBatchOperations.add(costPlanRecords);
    var costPlanSysIds = costPlanBatchOperations.process();