cancel
Showing results for 
Search instead for 
Did you mean: 

Create ticket for all the unassociated email in C4C

former_member15983
Participant
0 Kudos

Hi SDK Experts,

Need help on addressing this issue

Requirement:

When an Unassociated e-mails created in C4C system, we want to convert that email to ticket Via SDK, instead of manually exectuing the action - Convert to Ticket.I found that there is a standard method CreateWithReference in the ServiceRequest BO and tried to execute the below function at before save event of Activity BO.

var ticket = ServiceRequest.CreateWithReference(email,"SRRQ");

but i get an error "Access of member 'CreateWithReference' in a cross-deployment unit is not possible."

This is a show stopper for our project to go live.

Any inputs will be helpful, Please help!!

I want to tag

View Entire Topic
ravi_a3
Participant
0 Kudos

@premkumar.ms,

How did you solve this scenario? We are looking for this in our project to implement. How did you achieve it?

Thanks,
Ravi

dominik_g
Participant

ravi.a3 we had a similar implementation scenario. We used the default web service manageServiceRequestIn to create a new ticket based on information sent in the unassociated email.

  • Emails are instances of the BusinessObject Activity,
  • those activities have the TypeCode 39 (39= E-Mail) und GroupCode 0004 (0004 = Business E-Mail), with a filled ActivityFollowUpServiceRequestBlockingReasonCode (=this field is only filled on not assigned emails) und InitiatorCode = 2 (2= Inbound, 3 = Outbound)
  • the body of the email can be found in the TextCollection Text element with TextTypeCode 10002 (10002 = Body Text)

After Activity creation, a custom business object is created via an Internal Communication.

first web service call: Create ticket (SOAP Request)

var manageTicketRequest : ManageServiceRequestIn_PROD.MaintainBundle.Request;
var manageServiceRequest : ManageServiceRequestIn_PROD.MaintainBundle.Request.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest;
var manageServiceRequestBtdRef : ManageServiceRequestIn_PROD.MaintainBundle.Request.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest.BusinessTransactionDocumentReference;
manageServiceRequest.businessTransactionDocumentReferenceListCompleteTransmissionIndicator = true;
manageServiceRequest.actionCode = "04";
manageServiceRequest.DataOriginTypeCode = "5"; //5 = E-Mail
manageServiceRequest.Name = activity.SubjectName;
manageServiceRequest.BuyerParty.BusinessPartnerInternalID = contactPersonSoldToPartyMapping.SoldToPartyID;
manageServiceRequest.BuyerParty.MainContactParty.BusinessPartnerInternalID = contactPersonSoldToPartyMapping.ContactPersonID;
contactPersonID = manageServiceRequest.BuyerParty.MainContactParty.BusinessPartnerInternalID;
manageServiceRequest.textListCompleteTransmissionIndicator = true;
manageServiceRequestBtdRef.actionCode = "04";
manageServiceRequestBtdRef.BusinessTransactionDocumentRelationshipRoleCode = "1"; //1 = Predecessor
manageServiceRequestBtdRef.BusinessTransactionDocumentReferenceID.content = activity.ID.RemoveLeadingZeros();
manageServiceRequestBtdRef.BusinessTransactionDocumentReferenceTypeCode.content = "39"; //39 = E-Mail
manageServiceRequest.BusinessTransactionDocumentReference.Add(manageServiceRequestBtdRef);
manageTicketRequest.ServiceRequestBundleMaintainRequest2_sync.ServiceRequest.Add(manageServiceRequest);
var manageTicketResponse = ManageServiceRequestIn_PROD.MaintainBundle(manageTicketRequest, "", "CS_UEE_TicketIn_PROD");
if (!manageTicketResponse.ServiceRequestBundleMaintainConfirmation2_sync.Log.MaximumLogItemSeverityCode.IsInitial() && manageTicketResponse.ServiceRequestBundleMaintainConfirmation2_sync.Log.MaximumLogItemSeverityCode == "3")
{
	webserviceRequestError = true;
	
}
else if (!manageTicketResponse.CommunicationFault.MaximumLogItemSeverityCode.IsInitial() && manageTicketResponse.CommunicationFault.MaximumLogItemSeverityCode == "3")
{
	webserviceRequestError = true;
	
}
else {
	foreach(var serviceRequestResponse in manageTicketResponse.ServiceRequestBundleMaintainConfirmation2_sync.ServiceRequest) {
		if(!serviceRequestResponse.ID.content.IsInitial()) {
			serviceRequestID.content = serviceRequestResponse.ID.content;
			serviceRequestUUID.content = ABSL:UUID.ParseFromString(serviceRequestResponse.UUID.content);
			ticketCreated = true;
			break;
		}
	}
}

Second web service call to update email activitity (clear ActivityFollowUpServiceRequestBlockingReasonCode so that the email is not unassocaited anymore)

var body = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:glob=\"http://sap.com/xi/SAPGlobal20/Global\">"
+"<soap:Header/>"
	+"<soap:Body>"
		+"<glob:EmailActivityBundleMaintainRequest_sync_V1>"
			+"<EmailActivity actionCode=\"04\" businessTransactionDocumentReferenceListCompleteTransmissionIndicator=\"true\">"
				+"<ID>"+activity.ID.RemoveLeadingZeros()+"</ID>"
				+"<LifeCycleStatusCode>"+activityLifeCycleStatusCode+"</LifeCycleStatusCode>"
				+"<ActivityFollowUpServiceRequestBlockingReasonCode>"+activityFollowUpServiceRequestBlockingReasonCode+"</ActivityFollowUpServiceRequestBlockingReasonCode>"
				+"<BusinessTransactionDocumentReference actionCode=\"04\">"
				  +"<ID>"+serviceRequestID.content.RemoveLeadingZeros()+"</ID>"
				   +"<TypeCode>118</TypeCode>" //118 = Ticket
				   +"<RoleCode>2</RoleCode>" //2 = Successor
				+"</BusinessTransactionDocumentReference>"
				+"<MessageFromParty/>"
			+"</EmailActivity>"
		+"</glob:EmailActivityBundleMaintainRequest_sync_V1>"
	+"</soap:Body>"
+"</soap:Envelope>";

dominik_g
Participant

hope this helps 🙂

former_member15983
Participant
0 Kudos

Hi ravi.a3

We created an account with the name "Account update Required" and add this account as a default to the Email addresses communication channel.

So all the emails will first look for an account based on the sender email in any of that account's contact and update the account and if it couldn't find any corresponding account then it will update the account with the default "Account update Required". CSR will look at and create a prospect account or add that email to an existing account and proceed further. Hope this helps.

Thanks,

Prem.

0 Kudos

dominik.g,

our requirement : once a ticket is closed and customer try to reply on the same closed ticket via outlook,then the email gets into unassociated email.Which is a standard functionality but we want to convert that unassociated email into ticket via SDK.

Analysis done so far : My approach was to read the ID of unassociated email and using that link create a ticket via SDK by creating internal communication and in the custom bo of internal communication,i am unable to capture the ID(the mail sent by customer on the closed ticket via outlook/gmail) of unassociated email.

could you please help us with the approach?