public void CreateInterviewer(ITracingService tracer, IOrganizationService service, string name, int criteriaType, Guid systemuserID, Guid candidateID) { try { Entity newInterviewer = new Entity(dxc_interviewer); newInterviewer[dxc_name] = name; newInterviewer[dxc_systemuser_dxc_interviewer_InterviewerName] = new EntityReference(systemuser, systemuserID); newInterviewer[dxc_contact_dxc_interviewer_Candidate] = new EntityReference(contact, candidateID); service.Create(newInterviewer); tracer.Trace(help.SuccessfulTraceMsg(name)); } catch (Exception e) { tracer.Trace(help.UnsuccessfulTraceMsg(name)); throw new InvalidPluginExecutionException(e.Message); } }
//protected const string public EntityCollection GetSystemusersViaBusinessArea(ITracingService tracer, IOrganizationService service, int businessArea, int interviewerType) { try { tracer.Trace("GetSystemusersViaBusinessArea initiated 3 'Execute' !"); string fetchXML = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'> <entity name='systemuser'> <attribute name='fullname' /> <attribute name='businessunitid' /> <attribute name='firstname' /> <attribute name='middlename' /> <attribute name='lastname' /> <attribute name='dxc_businessarea' /> <attribute name='dxc_interviewertype' /> <attribute name='positionid' /> <attribute name='systemuserid' /> <order attribute='fullname' descending='false' /> <filter type='and'> <condition attribute='dxc_businessarea' operator='eq' value='" + businessArea + @"' /> <condition attribute='dxc_interviewertype' operator='eq' value='" + interviewerType + @"' /> </filter> </entity> </fetch>"; return(service.RetrieveMultiple(new FetchExpression(fetchXML))); } catch (Exception e) { tracer.Trace(help.UnsuccessfulTraceMsg("GetSystemusersViaBusinessArea")); tracer.Trace(e.Message); throw new InvalidPluginExecutionException(e.Message); } finally { tracer.Trace(help.SuccessfulTraceMsg("GetSystemusersViaBusinessArea")); } }