Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Copper Contributor
Posts: 18
Registered: ‎12-08-2009

Opportunity SalesProcess are not deleted?!

When an opportunity is deleted, the salesprocess and salesprocessaudit records remains...


In order to solve it:


OnBeforeDelete Event - Post Execute Step


  1. Add the AssemblyReference Sage.SalesLogix.BussinesRules.dll 
  2. Add using Sage.SalesLogix.BusinessRules;
  3. The code:

//Deleting SalesProcesses


IBusinessRuleHelperService service = new BusinessRuleHelper();
using(NHibernate.ISession _session = new Sage.Platform.Orm.SessionScopeWrapper()){
System.Collections.IList spId = _session.CreateSQLQuery("SELECT SALESPROCESSESID FROM SALESPROCESSES WHERE ENTITYID='"+opportunity.Id.ToString()+"'").List();
foreach(var item in spId)
service.DeleteRecords(string.Format("SALESPROCESSID = '{0}'", item.ToString()), "SALESPROCESSAUDIT");
service.DeleteRecords(string.Format("ENTITYID = '{0}'", opportunity.Id.ToString()), "SALESPROCESSES");



Posts: 165
Registered: ‎03-03-2009

Re: Opportunity SalesProcess are not deleted?!

Thank you Manuel.  I have logged defect 14095132 for the web client.  I did verify the network client is properly removing the entries from the those tables.

Loretta Carroll
QA Engineer