Hello there,
I am trying to achieve save of the outbound record and closing of the bundle upon clicking my custom button.
So,I invoke next code on click:
[code]var ServiceProvider = @case.MainInteraction.Agent.EntrepriseService.Provider;
IOutboundService outboundService = ServiceProvider.Resolve<IOutboundService>("outboundService");
// Record - IRecord
Record.CallResult = CallResult.ANSWER;
// put values from my form to record
foreach (var field in fields)
{
SaveValue(field.Field.DBName, field.CurrentValue);
}
Genesyslab.Enterprise.Commons.Collections.KeyValueCollection extension = new Genesyslab.Enterprise.Commons.Collections.KeyValueCollection();
extension.Add("BusinessCall", 1);
outboundService.UpdateRecord(agent.FirstMediaVoice.Device, Record, extension, null);
Dictionary<string, object> params = new Dictionary<string, object>();
params.Add("CommandParameter", Case.MainInteractionsBundle);
CommandManager.GetChainOfCommandByName("BundleClose").Execute(params);[/code]
But i got an exception during MarkProcessedOutboundChain:
InteractionWorkspace.Outbound.OutboundRecordViewModel: 18-06-18 13:17:25.105 [ 1] ERROR boundRecordViewModel - [.Outbound.] Exception in MarkProcessedOutboundChain
System.ArgumentException: Type Genesyslab.Enterprise.Services.CallResult is not supported by KeyValueCollection
Server stack trace:
at Genesyslab.Enterprise.Commons.Collections.KeyValueCollection.Add(String key, Object value)
at Genesyslab.Enterprise.Services.OutboundServiceHelper.FillUpUserData(IRecord record, KeyValueCollection data)
at Genesyslab.Enterprise.Services.OutboundService.RecordProcessedVoice(Object[] list)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at Genesyslab.Enterprise.Extensions.RequestWaiterProxy`1.EMethodDelegateM.EndInvoke(IAsyncResult result)
at Genesyslab.Enterprise.Extensions.RequestWaiterProxy`1.BeginInvoke(String expectedEvent, String errorEvent, IDevice expectedDevice, Int32 expectedChainID, Int32 expectedRecordHandle, IThreadSafeDictionary`2 proxyDict, EMethodDelegateM functionDelegate, AsyncCallback callBack, Object context, String correlatorData, Object[] list)
at Genesyslab.Enterprise.Services.OutboundService.BeginRecordProcessedVoice(IClientChannel channel, IDevice device, IInteraction interaction, IRecord record, KeyValueCollection extension, Int32 timeOut, AsyncCallback callBack, Object context, String correlatorData)
at Genesyslab.Enterprise.Services.OutboundService.RecordProcessed(IDevice device, IInteraction interaction, IRecord dataRecord, KeyValueCollection extension, String correlatorData, Int32 timeOut)
at Genesyslab.Desktop.Modules.Outbound.Windows.OutboundRecord.OutboundRecordViewModel.MarkProcessedOutboundChain(IInteraction ixn, IRecord rescheduledRecord, Nullable`1 rescheduleError, String chainOfCommandName)
It seems that the error occurs only when I reschedule record. In the case when I call first time, the exception does not invoked.
[b]edit[/b]:
Exception occurs only when the call result was set in the call list. If I set Unknown Call Result in the call list and than shedule a record than MarkProcessedOutboundChain works fine.
Is there a way to workaround?
[b]edit2[/b]:
Well, I find a way to bypass exception: set interaction-workspace/outbound.call-result-automatically-selected to Unknown, than chain pass MarkProcessedOutbound witouth problem.