on 11-07-2017 1:23 PM
Hi Experts,
I have urgent requirement to add a PDF Template in attachment of Service ticket via SDK
Can anyone suggest me how to add a PDF template in attachment of service ticket via SDK , Please suggest me your valuable suggestion.
Please suggest me ASAP.
ThankYou.
Thank You Keshav
Sorry for the late response I will try this now actually this task has been done by my other team member.
I will try for myself now.
Thank you again
Avinash Sunder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is answer.....
First we need to be able register a template Service Ticket in C4C. For this we can create a Document Type. Since we cannot authorize on these document types you might need to use a code list restriction to prevent end users from creating Service Ticket of this type, and only let for instance key users create and update templates.
For details on how to create an action in de SDK The action that we require will consist of two parts, First we need to find the template and then we need to copy the contents of the template to the current ticket.
Querying for the templates can be done with this code snippet:
//Query Template Service Requests var query = ServiceRequest.QueryByElements; var selectionParams = query.CreateSelectionParams(); selectionParams.Add(query.ProcessingTypeCode, "I","EQ","ZABU"); selectionParams.Add(query.ServiceIssueCategoryMainActivityCategoryKey.ServiceIssueCategoryID.content,"I","EQ", catkeyid); var resultData = query.ExecuteDataOnly(selectionParams); ticket = resultData.GetFirst(); if (ticket.IsInitial() == false ) { var template = ServiceRequest.Retrieve(ticket.UUID); foreach (var tempitem in template.Item ) { if (tempitem.ItemProduct.IsSet() ) { prodid = tempitem.ItemProduct.ProductInternalID; } } }Adding products to the current can be done with this code snippet:
//Add Product to Ticket. var lineID = 10; foreach (var tempitem in template.Item ) { if (tempitem.ItemProduct.IsSet() ) { prodid = tempitem.ItemProduct.ProductInternalID; if ( prodid.IsInitial() == false ) { servitem.ID =lineID.ToString(); servitem.UserServiceTransactionProcessingTypeCode = "Z001"; var institem = this.Item.Create(servitem); var quantity = 1; if (! institem.ItemProduct.IsSet()) { proditem.ProductKey.ProductID.content = prodid.content; institem.ItemProduct.Create(proditem); } else { institem.ItemProduct.ProductKey.ProductID.content = prodid.content; } if (! institem.FirstRequestedItemScheduleLine.IsSet()) { scheditem.Quantity.content = 1; institem.FirstRequestedItemScheduleLine.Create(scheditem); } else { institem.FirstRequestedItemScheduleLine.Quantity.content = 1; } lineID = lineID + 10; } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.