Forum Discussion
eli_donahue
8 years agoNew Member
Hi u2berggeist,
The Project ItemType has an OnBeforeUpdate server event (Project_saveProjectTree) that calls another method - processProjectTree. The processProjectTree method has logic that sends an email when an assignee is added/changed on an activity.
There are two options here if you do not want to send emails to the users.
Eli Donahue Aras Labs Software Engineer
- Comment out the following passage in the processProjectTree method.
'+++++ Send Emails Dim mailInDom As XmlDocument = New XmlDocument() Dim activeAssignment As XmlElement Dim activity As XmlElement Dim elem As XmlElement Dim flagNm As String = "use_identities_from_xml_only" Dim act_asnees_dict As New Hashtable 'key is activity&assignee (indicates that assignee is emailed about the activity) Dim k As String
For i = 0 To activities4email.Count - 1 activity = CType(activities4email.Item(i), XmlElement) mailInDom.LoadXml(activity.OuterXml) elem = CType(mailInDom.SelectSingleNode("Item/Relationships"), XmlElement) If Not elem Is Nothing Then elem.ParentNode.RemoveChild(elem)
mailInDom.DocumentElement.SetAttribute(flagNm, "1") k = String.Format(CultureInfo.InvariantCulture, "{0};{1}", activity.GetAttribute("id"), CCO.XML.GetItemProperty(activity, "managed_by_id")) act_asnees_dict.Add(k, "") CCO.ApplyItem.ExecuteMethodByName(mailInDom, outDom, "sendEmailToA2Assignee", True) If (CCO.XML.HasFault(outDom, False)) Then Exit Sub End If Next
For i = 0 To asmnts4email.Count - 1 activeAssignment = CType(asmnts4email.Item(i), XmlElement) activity = CType(activeAssignment.ParentNode.ParentNode, XmlElement) elem = CType(activeAssignment.SelectSingleNode("related_id/Item"), XmlElement) If elem Is Nothing Then k = activeAssignment.SelectSingleNode("related_id").InnerText Else k = elem.GetAttribute("id") End If k = String.Format("{0};{1}", activity.GetAttribute("id"), k)
If Not act_asnees_dict.Contains(k) Then mailInDom.LoadXml(activity.OuterXml) For Each elem In mailInDom.SelectNodes(String.Format("Item/Relationships/Item[@id!='{0}']", activeAssignment.GetAttribute("id"))) elem.ParentNode.RemoveChild(elem) Next elem mailInDom.DocumentElement.SetAttribute(flagNm, "1") CCO.ApplyItem.ExecuteMethodByName(mailInDom, outDom, "sendEmailToA2Assignee", True) If (CCO.XML.HasFault(outDom, False)) Then Exit Sub End If act_asnees_dict.Add(k, "") End If Next '----- Send Emails
This should prevent the emails from being sent, but I have not tested this workaround to confirm. Be sure to thoroughly test to ensure that the behavior when assigning activities does not change. - Enable email debugging for your instance. When email debugging is enabled for an Aras Innovator instance, any emails will be written to files on the server rather than sent via SMTP. This works for a dev/test environment, but I wouldn't recommend it for production. If activities are frequently assigned/reassigned, you could end up with a lot of files piling up on the server.
Eli Donahue Aras Labs Software Engineer