API Version
58.0
Requires Chatter
No
Signature
public static ConnectApi.ComplaintMgmtOutputRepresentation createComplaint(ConnectApi.ComplaintMgmtRequestInputRepresentation complaintMgmtRequestData)
Parameters
- complaintMgmtRequestData
- Type: ConnectApi.ComplaintMgmtRequestInputRepresentation
- Input representation of the request to create a public complaint.
Return Value
Example
ConnectApi.ComplaintMgmtRequestInputRepresentation input = new ConnectApi.ComplaintMgmtRequestInputRepresentation();
input.assessmentId='0U3RO0000000Cp20AE';
//caseInfo
ConnectApi.CaseInfoWrapper caseInfo=new ConnectApi.CaseInfoWrapper();
caseInfo.additionalInfo = new Map<String, ConnectApi.GenericObjectWrapper>();
ConnectApi.GenericObjectWrapper caseReason= new ConnectApi.GenericObjectWrapper();
caseReason.value='case reason';
caseInfo.additionalInfo.put('Reason', caseReason);
caseInfo.accountId='001RO000004WKi1YAG';
caseInfo.subject='Reversal of Account Annual Maintenance Charges';
caseInfo.status='Pending';
caseInfo.description='Annual maintenance charges to be reversed';
caseInfo.origin='Email';
caseInfo.reason='Other';
input.caseInfo = new ConnectApi.CaseInfoWrapper();
//complaintInfo
ConnectApi.ComplaintInfoWrapper complaintInfo=new ConnectApi.ComplaintInfoWrapper();
complaintInfo.incidentDate = '2022-04-07';
complaintInfo.type = 'Information, sums/charges or product performance';
complaintInfo.subType = 'Product disclosure information';
complaintInfo.status = 'In Progress';
complaintInfo.subject = 'Account Annual Maintenance Charges';
complaintInfo.priority = 'High';
complaintInfo.description = 'Annual maintenance charges not disclosed upfront';
complaintInfo.email = 'Tody@email.com';
complaintInfo.productTye = 'Credit Card or Prepaid Card';
complaintInfo.additionalInfo=new Map<String, ConnectApi.GenericObjectWrapper>();
ConnectApi.GenericObjectWrapper sourceTypeObj= new ConnectApi.GenericObjectWrapper();
sourceTypeObj.value=sourceType;
complaintInfo.additionalInfo.put('SourceType', sourceTypeObj);
input.complaintInfo = new ConnectApi.ComplaintInfoWrapper();
//caseParticipantInfo
input.caseParticipantInfo = new List<ConnectApi.CaseParticipantInfoWrapper>();
ConnectApi.CaseParticipantInfoWrapper caseParticipantInfo = new ConnectApi.CaseParticipantInfoWrapper();
caseParticipantInfo.participantId = '001RO000004KYfrYAG';
caseParticipantInfo.role = 'Complainant Representative';
caseParticipantInfo.status = 'Pending';
caseParticipantInfo.preferredCallTimeFrom = '10:30:30';
caseParticipantInfo.preferredCallTimeTo = '12:30:30';
caseParticipantInfo.preferredCommunicationMode = 'Email';
caseParticipantInfo.authorizationProof = 'Email';
input.caseParticipantInfo.add(caseParticipantInfo);
//documentInfoAttributes
ConnectApi.DocumentInfoAttributesWrapper doc1=new ConnectApi.DocumentInfoAttributesWrapper();
doc1.id='069RO00000048wfYAA';
doc1.name='PAN';
doc1.typeId='0deRO00000000J7YAI';
//documentInfoAttributesList
input.documentInfo=new List<ConnectApi.DocumentInfoAttributesWrapper>();
input.documentInfo.add(doc1);
input.shouldInclInRegulatoryRpt=true;
System.debug(ConnectApi.IComplaintMgmtConnectFamily.createComplaint(input));