addMembersWithPlans(membersWithPlansInputRepresentation, censusId)

Add a family of group census members and their insurance plans to a group census in a single request.

68.0

No

public static ConnectApi.MembersWithPlansRepresentation addMembersWithPlans(ConnectApi.MembersWithPlansInputRepresentation membersWithPlansInputRepresentation, String censusId)

membersWithPlansInputRepresentation

censusId

  • Type: String
  • ID of the group census to add the members to.

Type: ConnectApi.MembersWithPlansRepresentation

Use this method to add a family of group census members, along with the insurance plans for each member, to a group census in a single call. Specify the group census in censusId and the members in the members property of the input representation.

For each member, specify name. Specify the member’s plans in groupCensusMemberPlans. The addedPlans, upsertedPlans, and deletedPlans properties apply only when you update members with updateMembersWithPlans(membersWithPlansInputRepresentation, censusId).

To relate a dependent to a primary member, set the dependent’s primaryGroupCensusMemberId and associationWithPrimaryMbr properties. For each plan, specify either contractGroupPlanId for a plan on the census’s contract, or productCode and rootProductCode for an off-contract coverage.

Members are checked for duplicates by using the FirstName, LastName, AssociationWithPrimaryMbr, Email, and GroupCensusId fields. To include more fields in the duplicate check, specify their API names in duplicateDetectionFields.

Check the isSuccess property of the response to determine whether the operation succeeded. Request-level errors are in the top-level errors property, which is empty when isSuccess is true. Member-specific errors are in the errors property of each item in members.

Here’s an example of how to add a primary group census member and a dependent, each with their insurance plans, from Apex code. When you add a member, don’t set the id property, and specify the member’s plans in groupCensusMemberPlans.