이 작업은 영업 기회, 견적, 판매 주문 또는 송장 엔터티에 대한 기본 가격 계산을 트리거하는 데 사용됩니다. 이 조치는 서버 및 클라이언트 호출 모두에 적용할 수 있습니다.
매개 변수
| 이름 | 유형 | 필수 | Description |
|---|---|---|---|
| 엔티티논리 이름 | String | Yes | 엔터티 논리적 이름 |
| entityId | GUID | Yes | 엔터티 GUID |
예시
서버 호출
요청
POST [Organization URI]/api/data/v9.1/RecalculatePrice
{
"entityLogicalName": "quote",
"entityId":"00aa00aa-bb11-cc22-dd33-44ee44ee44ee"
}
응답
HTTP/1.1 204 No Content
OData-Version: 4.0
클라이언트 호출
function RecalculatePrice(formContext) {
var recalculatePriceRequest = {
entityId: formContext.data.entity.getId(),
entityLogicalName: formContext.data.entity.getEntityName(),
Target: parameters.Target,
getMetadata: function () {
return {
boundParameter: null,
parameterTypes: {
"entityId": {
"typeName": "Edm.Guid",
"structuralProperty": 5,
},
"entityLogicalName": {
"typeName": "Edm.String",
"structuralProperty": 1,
},
},
operationType: 0,
operationName: "RecalculatePrice"
};
}
};
Xrm.WebApi.online.execute(recalculatePriceRequest).then(
function success(result) {
if (result.ok) {
//Success
}
},
function (error) {
Xrm.Utility.alertDialog(error.message);
}
);
}