CostPlanBatchOperations - 전역
일괄 처리를 사용하여 수요 및 프로젝트에 대해 많은 수의 비용 계획 기록을 만들 수 있는 메서드를 제공합니다. 여러 비용 계획 기록을 보다 효율적으로 생성하려면 GlideRecord 대신 이 API를 사용합니다.
CostPlanBatchOperations.add() 메서드를 사용하여 배치 큐에 원하는 수의 비용 계획을 추가합니다. 필요한 비용 계획을 모두 추가했으면 CostPlanBatchOperations.process() 메서드를 사용하여 인스턴스에 비용 계획을 실제로 생성/삽입합니다. CostPlanBatchOperations.process() 메서드를 호출할 때까지 추가 요청은 배치 대기열에 남아 있습니다(아직 인스턴스에 추가되지 않음). 어떤 이유로든 배치 큐에서 모든 비용 계획을 제거해야 하는 경우 CostPlanBatchOperations.clear() 메서드를 사용합니다.
이 API를 사용하려면 com.snc.financial_planning_pmo 플러그인을 활성화해야 합니다.
CostPlanBatchOperations - add(costPlan 객체)
지정된 작업(프로젝트 또는 수요)에 하나 이상의 비용 계획을 추가합니다. 여러 비용 계획을 생성하려는 경우 이 방법을 사용합니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| 비용 계획 | 객체 | 기존 작업에 추가할 각 비용 계획을 설명하는 하나 이상의 객체 또는 객체 배열입니다. |
| costPlan.name | 문자열 | 비용 계획의 이름입니다. 최대 길이: 130자 |
| costPlan.task | 문자열 | 이 비용 계획과 연결할 프로젝트 또는 수요의 Sys_id입니다. 다음 테이블 중 하나에서 이 값을 찾을 수 있습니다.
|
| 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] 테이블을 참조하십시오. |
| 유형 | 설명 |
|---|---|
| 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() 메서드를 사용하여 추가된 모든 비용 계획 객체를 제거합니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| 없음 |
| 유형 | 설명 |
|---|---|
| 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() 메서드를 사용하여 추가된 모든 비용 계획을 처리하고 해당 비용 계획 및 관련 롤업을 만듭니다.
비용 계획이 성공적으로 처리되면 비용 계획 큐가 지워집니다.
| 이름 | 유형 | 설명 |
|---|---|---|
| 없음 |
| 유형 | 설명 |
|---|---|
| 배열 | 생성된 각 비용 계획의 시스템 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();