您在此处:
InsCensusService:addPlanSelections
使用此服务为输入中指定的每个成员插入预注册的计划。
方法:addPlanSelections
工作原理
-
⁇
ContractLineId__c节点包含成员预注册的 ⁇ContractLineItem__c⁇ ID ⁇ 。 -
对于每个客户
ContractLineItem__cID,服务会评估计划是否对成员有效,如下所示:-
contractId建议对建议有效censusId; -
ContractLineItem__c⁇ Id ⁇ 对 ⁇contractId有效; -
主要成员的推荐
ContractLineItem__c书的产品类型不等于主要成员推荐书中列出的产品类型OptOutTypes__c; -
受抚养人的委托
ContractLineItem__c书的产品类型不等于受抚养人委托书中列出的产品类型OptOutTypes__c,并且受抚养人委托ContractLineItem__c书的产品类型不等于受抚养人主要成员OptOutTypes__c中列出的产品类型。
-
-
将返回成功创建的
GroupCensusMemberPlan__c条目的 ID。 -
该服务还会删除新创建的成员(
isNewMember在 JSON 对象中设置为真),因为新创建的成员在 ⁇GroupCensusMemberPlan__c中没有条目,并且当onlySaveMembersWithValidProducts⁇ 设置为真时。
远程选项
选项 |
说明 |
|---|---|
|
必需。 必须插入计划的成员的人口普查 ID。 验证 contractId 是否属于客户/人口普查。 |
|
必需。 客户当前合同的 ID。 验证每个成员的计划是合同的一部分。 |
|
必需。 具有两个节点的 JSON 对象:
|
|
可选。 如果为真,则删除未在 ⁇ 中 |
输入 JSON
以下是输入 JSON 的格式:
{
"censusId":"ID",
"contractId":"ID",
"onlySaveMembersWithValidProducts":true,
"census":{
"headers":[
{
"name":"vlocity_ins__ContractLineId__c"
},
],
"members":[
{
"Id":"Census Member ID",
"isNewMember":true,
"vlocity_ins__ContractLineId__c": "ContractLineItem__c.Id;ContractLineItem__c.Id"
},
{
"Id":"Census Member ID",
"isNewMember":true,
"vlocity_ins__ContractLineId__c": "ContractLineItem__c.Id;ContractLineItem__c.Id"
}
]
},
}以下是输入 JSON 的示例:
{
"censusId":"a4D4P000000hbjSUAQ",
"contractId":"8004P000000zF2dQAE",
"census":{
"members":[
{
"vlocity_ins__ContractLineId__c": "a4D4P000000hbjSUAQ;a4D4P000000hbjSUAQ",
"Id":"a4C4P000000d7POUAY"
}
],
"headers":[
{
"name":"vlocity_ins__ContractLineId__c"
}
]
}
}输出 JSON
该服务返回成功插入的GroupCensusMemberPlan__c ID 列表。它还提供了遇到的错误列表。这些错误按成员分组。
以下是输出 JSON 的格式:
{
"memberPlanIds":[
"GroupCensusMemberPlan__c.Id"
],
"errors":[
{
"error":"error"
}
]
}该服务返回输出 JSON,格式如下:
{
"memberPlanIds":[
"a4B4P000006jKsMUAU",
"a4B4P000006jKsNUAU",
"a4B4P000006jKsOUAU",
"a4B4P000006jKsPUAU"
],
"errors":[
{
"numPlansError":2,
"error":"ContractLineItem__c value is not valid:8004P000000zJKjQAM; Medical",
"numPlans":2,
"Id":"a4C4P000000ed6dUAA",
"isNewMember":true,
"vlocity_ins__ContractLineId__c":"8004P000000zJKjQAM;Medical"
}
]
}
