I believe IWS will only be able to update records that are in Retrieved state within OCS. If records are in Ready state and therefore not in OCS memory, direct DB manipulation will be needed.
In my case, I have done direct DB manipulation successfully many times - to add/remove records, update records, etc (but again, ONLY if record is in Ready state). Also it is probably bad design to connect directly to DB from IWS client desktop. What I have done in the past is expose a web service that does the DB manipulation for me, then have IWS consume the web service. In my opinion this is cleaner and I get centralized logging for troubleshooting purposes if needed.
For records in Retrieved state sitting on agent desktop, I do something like this:
[code]
// method to update outbound record that is sitting on agent desktop
public static Boolean UpdateRecord(IInteraction interaction, IAgent agentManager, String fieldName, String fieldValue)
{
Boolean retVal;
try
{
IEnterpriseServiceProvider serviceProvider = agentManager.EntrepriseService.Provider;
IOutboundService outboundService = serviceProvider.Resolve<IOutboundService>("outboundService");
Genesyslab.Enterprise.Interaction.OutboundRecord dataRecord = default(Genesyslab.Enterprise.Interaction.OutboundRecord);
Genesyslab.Enterprise.Model.Interaction.IChainRecord chainRecords = default(Genesyslab.Enterprise.Model.Interaction.IChainRecord);
chainRecords = interaction.OutboundChainRecord;
System.Collections.Generic.ICollection<Genesyslab.Enterprise.Model.Interaction.IRecord> collectionOfRecords = default(System.Collections.Generic.ICollection<Genesyslab.Enterprise.Model.Interaction.IRecord>);
collectionOfRecords = chainRecords.Records;
dataRecord = (OutboundRecord)collectionOfRecords.ElementAt(collectionOfRecords.Count - 1);
System.Collections.Generic.Dictionary<string, object> customFields = new System.Collections.Generic.Dictionary<string, object>();
customFields.Add(fieldName, fieldValue);
dataRecord.CustomFields = customFields;
Genesyslab.Enterprise.Commons.Collections.KeyValueCollection extension = new Genesyslab.Enterprise.Commons.Collections.KeyValueCollection();
extension.Add("BusinessCall", 1);
outboundService.UpdateRecord(agentManager.FirstMediaVoice.Device, dataRecord, extension, null);
retVal = true;
}
catch (Exception)
{
retVal = false;
}
return retVal;
}
[/code]