/// <summary> /// Get required details to build WebRequest /// </summary> public void MultiVinWarrantyCheck(IIncident incidentRecord) { try { _rnConnectService = RightNowConnectService.GetService(); _incidentRecord = incidentRecord; string multiWarrantyConfigValue = _rnConnectService.GetConfigValue("CUSTOM_CFG_NEW_BOM_QUERY"); if (multiWarrantyConfigValue != null) { var s = new JavaScriptSerializer(); var configVerb = s.Deserialize <ConfigVerbs.RootObject>(multiWarrantyConfigValue); _curlURL = configVerb.URL; _headerURL = configVerb.xmlns; _xmlnsURL = configVerb.RESTHeader.xmlns; _respApplication = configVerb.RESTHeader.RespApplication; _responsibility = configVerb.RESTHeader.Responsibility; _securityGroup = configVerb.RESTHeader.SecurityGroup; _nLSLanguage = configVerb.RESTHeader.NLSLanguage; _orgID = configVerb.RESTHeader.Org_Id; } _rnConnectService._incidentVINObjects.Clear();//Clear the _incidentVINObjects variable that holds all incident_vin record to be updated with response _causalPart = RightNowConnectService.GetService().getFieldFromIncidentRecord("CO", "causal_part_nmbr", incidentRecord); string[] internalIncInfo = _rnConnectService.GetInternalIncident(incidentRecord.ID); if (internalIncInfo != null) { _allInternalincident = internalIncInfo.ToList(); } if (_allInternalincident.Count > 0) { var tasks = new Task[_allInternalincident.Count]; int ii = 0; foreach (string internalIncident in _allInternalincident) { tasks[ii++] = Task.Factory.StartNew(() => RequestPerSR(internalIncident)); } Task.WaitAll(tasks); _rnConnectService.updateIncidentVinRecords();//Once all task over, call batch job to update Incident_VIN record } } catch (Exception ex) { WorkspaceAddIn.InfoLog("Exeption in GetDetails: " + ex.Message); } }