public void UpdateTransactionRecord(IDataService dataService, IRecordPointer <Guid> transactionId, IRecordPointer <Guid> currentStepId) { try { if (dataService is null) { throw new ArgumentNullException("dataService"); } if (transactionId is null) { throw new ArgumentNullException("transactionId"); } if (currentStepId is null) { throw new ArgumentNullException("currentStepId"); } var entity = new ccllc_transaction { Id = transactionId.Id, ccllc_CurrentStepId = new EntityReference(ccllc_processstep.EntityLogicalName, currentStepId.Id) }; dataService.ToOrgService().Update(entity); } catch (Exception ex) { throw ex; } }
public ITransactionRecord NewTransactionRecord(IDataService dataService, IRecordPointer <Guid> initiatingAgentId, IRecordPointer <Guid> initiatingLocaitonId, IRecordPointer <Guid> customerId, IRecordPointer <Guid> contextRecordId, IRecordPointer <Guid> transactionTypeId, IRecordPointer <Guid> initiatingProcessId, IRecordPointer <Guid> currentProcessId, IRecordPointer <Guid> currentStepId, string name) { ccllc_transaction transaction = new ccllc_transaction { ccllc_InitiatingAgentId = initiatingAgentId?.ToEntityReference(), ccllc_InitiatingLocationId = initiatingLocaitonId?.ToEntityReference(), ccllc_CustomerId = customerId?.ToEntityReference(), ccllc_ContextRecordType = contextRecordId?.RecordType, ccllc_ContextRecordGUID = contextRecordId?.Id.ToString(), ccllc_TransactionTypeId = transactionTypeId?.ToEntityReference(), ccllc_InitiatingProcessId = initiatingProcessId?.ToEntityReference(), ccllc_CurrentProcessId = currentProcessId?.ToEntityReference(), ccllc_CurrentStepId = currentStepId?.ToEntityReference(), ccllc_name = name }; transaction.Id = dataService.ToOrgService().Create(transaction); return(transaction); }