Topic by Salvatore
Content
Hi,
we are updating a custom field (Answers) using the following code and that is supposed to trigger a custom process associated to the Update event. That worked in the past leading to timeout errors:
File: dquery/spmerrorshandler.cpp
Line: 249
In Fcn: SPMErrorsHandler::insert_stats
Description: Object Event Handler UpdateAnswerProducts failed while processing an Answer object with ID 30001:
Limit Exceeded: Maximum Runtime: 5.000000s
So we decided to set the custom process to run asynchronously, but now the process is no longer triggered.
IMPORTANT:
- The custom field is set correctly and the standard "Date updated" field for the answers correspond to the date of the last update via SOAP API, but the CPM is not triggered and now no errors are logged in the Logs page nor in the local log file.
- If the custom field is set via a Console add-in with the same configuration (SuppressExternalEvents and SuppressRules both set to FALSE), the CPM runs as expected
NamedID tagStatusID = new NamedID(); tagStatusID.ID = new ID(); tagStatusID.ID.id = Convert.ToInt64(_TagStatuses[value.ToUpper().Trim()]); tagStatusID.ID.idSpecified = true; GenericField CF = new GenericField(); CF.name = CFname; CF.dataType = DataTypeEnum.NAMED_ID; CF.dataTypeSpecified = true; CF.DataValue = new DataValue(); CF.DataValue.Items = new object[] { tagStatusID }; CF.DataValue.ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.NamedIDValue }; GenericObject customFieldsc = new GenericObject(); customFieldsc.GenericFields = new GenericField[] { CF }; customFieldsc.ObjectType = new RNObjectType(); customFieldsc.ObjectType.TypeName = "AnswerCustomFieldsc"; GenericField GF = new GenericField(); GF.name = "c"; GF.dataType = DataTypeEnum.OBJECT; GF.dataTypeSpecified = true; GF.DataValue = new DataValue(); GF.DataValue.Items = new object[] { customFieldsc }; GF.DataValue.ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.ObjectValue }; Answer answer = new Answer(); answer.ID = new ID(); answer.ID.id = Convert.ToInt64(AnswerID); answer.ID.idSpecified = true; answer.CustomFields = new GenericObject(); answer.CustomFields.ObjectType = new RNObjectType(); answer.CustomFields.ObjectType.TypeName = "AnswerCustomFields"; answer.CustomFields.GenericFields = new GenericField[] { GF }; RNObject[] updateObjects = new RNObject[] { answer }; //Set the processing options UpdateProcessingOptions options = new UpdateProcessingOptions(); options.SuppressExternalEvents = false; options.SuppressRules = false; _service.Update(_clientInfoHeader, updateObjects, options);