Loading
保險
InsCensusService:updateMembersWithPlans

InsCensusService:updateMembersWithPlans

使用此服務可將主要成員、其下屬及其預先註冊的計畫填入普查。

重要
重要 自 Winter '23 起,我們已啟用 InsCensusServiceStd:updateMembersWithPlans 服務,以使用 Financial Services Cloud 和 Health Cloud 的 Salesforce 標準資料模型。現有客戶可以繼續使用此服務,但保險受管理封裝中不會提供進一步的增強功能。

類別:InsCensusService

方法:updateMembersWithPlans

運作方式

  • 服務會呼叫 updateMembers 以儲存成員的相關資料、剖析 JSON 物件中的成員,並為每個成員新增識別碼和 isNewMember。

  • 接著服務會呼叫 addPlanSelections 以儲存成員的預先註冊計畫。

  • 如果 isNewMember 設定為 true,則 addPlanSelections 會刪除任何未在 GroupCensusMemberPlan__c 中具有項目的新建立成員,且如果 onlySaveMembersWithValidProducts 參數設定為 true。

遠端選項

選項

描述

censusId 

必要

要上載成員所屬或將屬的普查識別碼。

用於驗證 contractId 屬於帳戶/普查。

contractId 

必要

帳戶目前契約的識別碼。

用於驗證每個成員的計畫是否為契約的一部分。

onlySaveMembersWithValidProducts

布林值

如果為 true,則會刪除沒有 GroupCensusMemberPlan__c 項目的新成員。

duplicateKeys

已串連清單

GroupCensusMember__c 的 fieldAPI 名稱清單

用於判斷哪些成員已存在於表格中,在此情況下會執行更新而非插入。

輸入 JSON

以下是輸入 JSON 的格式外觀:

{
   "censusId":"a4D4P000000hbjSUAQ",
   "contractId":"a4D4P000000yujQER",
   "onlySaveMembersWithValidProducts":true,
   "census":{
      "headers":[
         {
            "name":"vlocity_ins__FirstName__c"
         },
         {
            "name":"vlocity_ins__LastName__c"
         },
         {
            "name":"vlocity_ins__IsPrimaryMember__c"
         },
         {
            "name":"vlocity_ins__IsSpouse__c"
         },
         {
            "name":"vlocity_ins__MemberIdentifier__c"
         },
         {
            "name":"vlocity_ins__PrimaryMemberIdentifier__c"
         },
         {
            "name":"Id"
         },
         {
            "name":"vlocity_ins__ContractLineId__c"
         },
         {
            "name":"vlocity_ins__IsOptOut__c"
         },
         {
            "name":"vlocity_ins__OptOutTypes__c"
         }
      ],
      "members":[
         {
            "vlocity_ins__FirstName__c":"Maurice",
            "vlocity_ins__LastName__c":"Johnson",
            "vlocity_ins__IsPrimaryMember__c":true,
            "vlocity_ins__IsSpouse__c":false,
            "vlocity_ins__MemberIdentifier__c":"Maurice",
            "vlocity_ins__PrimaryMemberIdentifier__c":null,
            "vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ;a4D4P000000hbjSUAQ",
            "vlocity_ins__IsOptOut__c" : false,
            "vlocity_ins__OptOutTypes__c" :null
         },
         {
            "vlocity_ins__FirstName__c":"Lizzy",
            "vlocity_ins__LastName__c":"Johnson",
            "vlocity_ins__IsPrimaryMember__c":false,
            "vlocity_ins__IsSpouse__c":false,
            "vlocity_ins__MemberIdentifier__c":"Lizzy",
            "vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
            "vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
            "vlocity_ins__IsOptOut__c" :true,
            "vlocity_ins__OptOutTypes__c" :null
         },
         {
            "vlocity_ins__FirstName__c":"Jamie",
            "vlocity_ins__LastName__c":"Johnson",
            "vlocity_ins__IsPrimaryMember__c":false,
            "vlocity_ins__IsSpouse__c":true,
            "vlocity_ins__MemberIdentifier__c":"Jamie",
            "vlocity_ins__PrimaryMemberIdentifier__c":"Maurice",
            "vlocity_ins__ContractLineId__c":"a4D4P000000hbjSUAQ",
            "vlocity_ins__IsOptOut__c" : false,
            "vlocity_ins__OptOutTypes__c" :"Medical"
         },
         {
            "vlocity_ins__FirstName__c":"Bella",
            "vlocity_ins__LastName__c":"James",
            "vlocity_ins__IsPrimaryMember__c":true,
            "vlocity_ins__IsSpouse__c":false,
            "vlocity_ins__MemberIdentifier__c":"Bella",
            "vlocity_ins__PrimaryMemberIdentifier__c":null,
            "vlocity_ins__ContractLineId__c":null,
            "vlocity_ins__IsOptOut__c" :true,
            "vlocity_ins__OptOutTypes__c" :null
         }
      ]
   },
   "duplicateKeys" : [
      "vlocity_ins__FirstName__c",
      "vlocity_ins__LastName__c"
   ]
}

輸出 JSON

以下是範例輸出 JSON:

{  
   "errors":[  
      {  
         "error":"ContractLineItem__c value is not valid:8004P000000zJKjQAM; Medical",
         "vlocity_ins__FirstName__c":"Maurice",
         "vlocity_ins__LastName__c":"Johnson",
         "vlocity_ins__IsPrimaryMember__c":true,
         "vlocity_ins__IsSpouse__c":false,
         "vlocity_ins__MemberIdentifier__c":"Maurice",
         "vlocity_ins__PrimaryMemberIdentifier__c":null
      }
   ],
   "censusMemberIds":[  
      "a4C4P000000ed6dUAA",
      "a4C4P000000ed6eUAA",
      "a4C4P000000ed6fUAA"
   ],
   "memberPlanIds":[  
      "a4B4P000006jKsMUAU",
      "a4B4P000006jKsNUAU",
      "a4B4P000006jKsOUAU",
      "a4B4P000006jKsPUAU"
   ]
}
 
正在載入
Salesforce Help | Article