Community
Showing results for 
Search instead for 
Do you mean 
Reply

Error: Failed to execute 'DeleteEntity' command

Bronze Super Contributor
Posts: 1,231
Country: USA

Error: Failed to execute 'DeleteEntity' command

Can anybody help on this SDK error Failed to execute 'DeleteEntity' command.

 

 Here is the code.. 

public static bool SubEntityDelete(string sEntityName) { try { if (Durkin.Common.Classes.ACTData.CanUserModifyDatabase == true) { //------------------------------------ // Get the Current Entity Descriptor //------------------------------------ CustomEntityDescriptor cDescriptor = CustomSubEntity.GetCustomEntityDescriptor(sEntityName); //------------------------------------ // Does this Entity exists? //------------------------------------ if (cDescriptor == null) { return true; } else { //------------------------------------------------------------- // Lock the database since we are doing a schema changes. //------------------------------------------------------------- CommonPlugin.ACTAPP.ActFramework.Database.LockDatabase(Act.Framework.DatabaseLockReason.Delete); //------------------------------------------------------------- // Delete the custom sub-entity. //------------------------------------------------------------- CommonPlugin.ACTAPP.ActFramework.CustomEntities.DeleteCustomEntity(cDescriptor); //------------------------------------------------------------- // Since we suspended the notification // we need to manually refresh the schema //------------------------------------------------------------- CommonPlugin.ACTFM.Fields.RefreshSchema(); //------------------------------------------------------------- // Unlock the database. //------------------------------------------------------------- CommonPlugin.ACTAPP.ActFramework.Database.UnlockDatabase(); } return true; } else { if (CommonPlugin.ACTFM.ActDatabase.IsSubscriber()) { MessageBox.Show("You cannot make changes to a remote database.", CommonPlugin.AssemblyInfo.Product, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("You do not have privileges to make changes to the database.", CommonPlugin.AssemblyInfo.Product, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return false; } } catch (Exception ex) { throw ex; } return false; }

 

 

 

Here is the stack trace...

 

ROUTINE:       uiBtnCustomViewDelete_Click
TARGET:        EntityDeleteEntity
TYPE:          System.Exception
MESSAGE:       Failed to execute 'DeleteEntity' command.
SOURCE :       Act.Framework
PLUGIN:        Durkin.Common.Classes
VERSION:       2.0.9.51
ACT:           11.0.367.0
SOURCE:        Act.Framework
VERSION:       11.0.367.0
STACK:         at Act.Framework.Database.DefineEntityManagerDB.EntityDeleteEntity(Guid& entityId)
   at Act.Framework.Database.DefineEntityManager.DeleteEntity(CustomEntityDescriptor entity)
   at Act.Framework.CustomEntities.CustomEntityManager.DeleteCustomEntity(CustomEntityDescriptor descriptor)
   at Durkin.Common.Classes.CustomSubEntity.SubEntityDelete(String sEntityName) in C:\DurkinComputing\_NET20_Durkin.Common.Classes\Durkin.Common.Classes\CustomSubEntity.vb:line 2364
   at Durkin.Common.Classes.frmEntityDefine.uiBtnCustomViewDelete_Click(Object sender, EventArgs e) in C:\DurkinComputing\_NET20_Durkin.Common.Classes\Durkin.Common.Classes\Forms\frmEntityDefine.vb:line 802

TIME:          9/3/2008 10:34:39 AM
ACT NAME:      ActSage, Version=11.0.367.0, Culture=neutral, PublicKeyToken=ebf6b2ff4d0a08aa
MACHINE        DELL9200
IP             xxx.xxx.xxx.xxx
USER           DELL9200\jim durkin


---- Stack Trace ---
Stack:0:    Durkin.Common.Utilities.DisplayError.EnhancedStackTrace()
       DisplayError.vb: line 0513, col 13, IL 0006
Stack:1:    Durkin.Common.Utilities.DisplayError.Write(myException As Exception, sRoutine As String, sPluginName As String, sPluginVersion As String, sEmailFromAddress As String, sFromFullName As String)
       DisplayError.vb: line 0133, col 21, IL 1935
Stack:2:    Durkin.Common.Classes.LogError.Write(myException As Exception, sDescription As String)
       LogError.vb: line 0008, col 17, IL 0136
Stack:3:    Durkin.Common.Classes.frmEntityDefine.uiBtnCustomViewDelete_Click(sender As Object, e As EventArgs)
       frmEntityDefine.vb: line 0856, col 13, IL 0564
Stack:4:    System.Windows.Forms.Control.OnClick(e As EventArgs)
       ActSage.exe: N 00106
Stack:5:    Janus.Windows.EditControls.UIButton.OnClick(e As EventArgs)
       ActSage.exe: N 00131
.....

.....
Stack:51:    Act.Application.SingletonApp.Run(startupForm As Form)
       ActSage.exe: N 00075
Stack:52:    Act.Application.Act.Main(args As String[])
       ActSage.exe: N 02536

%0A

ExceptionToStringSmiley SadInner Exception)
(Inner Exception)
Exception Source:      .Net SqlClient Data Provider
Exception Type:        System.Data.SqlClient.SqlException
Exception Message:     Invalid column name 'EDITUSERID'.
Invalid column name 'CREATEUSERID'.
Invalid column name 'MANAGEUSERID'.
Invalid column name 'ISPRIVATE'.
Invalid column name 'MANAGEUSERID'.
Invalid column name 'CUST_ColorInList_102858352'.
Invalid column name 'CUST_Completed_102911456'.
Invalid column name 'CUST_Confirmed_102910800'.
Invalid column name 'CREATEDATE'.
Invalid column name 'CUST_Description_102914108'.
Invalid column name 'EDITDATE'.
Invalid column name 'CUST_EndDateTime_102912704'.
Invalid column name 'CUST_Location_102910176'.
Invalid column name 'CUST_Notes_102919193'.
Invalid column name 'CUST_NotesInternal_102913421'.
Invalid column name 'CUST_ParentEntityID_102858929'.
Invalid column name 'CUST_ParentEntityName_102859522'.
Invalid column name 'CUST_PositionInList_102857712'.
Invalid column name 'ISPRIVATE'.
Invalid column name 'CUST_ProjectLead_102905746'.
Invalid column name 'CUST_ProjectName_102904576'.
Invalid column name 'CUST_ProjectType_102905169'.
Invalid column name 'ProjectsID'.
Invalid column name 'CUST_StartDateTime_102912064'.
Exception Target Site: OnError

---- Stack Trace ----%0A
Stack:0:    System.Data.SqlClient.SqlConnection.OnError(exception As SqlException, breakConnection As Boolean)
       ActSage.exe: N 925466
Stack:1:    System.Data.SqlClient.SqlInternalConnection.OnError(exception As SqlException, breakConnection As Boolean)
       ActSage.exe: N 800118
Stack:2:    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(stateObj As TdsParserStateObject)
       ActSage.exe: N 00186
Stack:3:    System.Data.SqlClient.TdsParser.Run(runBehavior As RunBehavior, cmdHandler As SqlCommand, dataStream As SqlDataReader, bulkCopyHandler As BulkCopySimpleResultSet, stateObj As TdsParserStateObject)
       ActSage.exe: N 01932
Stack:4:    System.Data.SqlClient.SqlCommand.FinishExecuteReader(ds As SqlDataReader, runBehavior As RunBehavior, resetOptionsString As String)
       ActSage.exe: N 00149
Stack:5:    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(cmdBehavior As CommandBehavior, runBehavior As RunBehavior, returnStream As Boolean, async As Boolean)
       ActSage.exe: N 01005
Stack:6:    System.Data.SqlClient.SqlCommand.RunExecuteReader(cmdBehavior As CommandBehavior, runBehavior As RunBehavior, returnStream As Boolean, method As String, result As DbAsyncResult)
       ActSage.exe: N 00132
Stack:7:    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(result As DbAsyncResult, methodName As String, sendToPipe As Boolean)
       ActSage.exe: N 00149
Stack:8:    System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       ActSage.exe: N 00135
Stack:9:    Act.Data.ActDb.ActDbCommand.ExecuteNonQuery()
       ActSage.exe: N 00031

%0A

(Outer Exception)
Exception Source:      Act.Data
Exception Type:        Act.Data.ActDb.ActDbException
Exception Message:     Invalid column name 'EDITUSERID'.
Invalid column name 'CREATEUSERID'.
Invalid column name 'MANAGEUSERID'.
Invalid column name 'ISPRIVATE'.
Invalid column name 'MANAGEUSERID'.
Invalid column name 'CUST_ColorInList_102858352'.
Invalid column name 'CUST_Completed_102911456'.
Invalid column name 'CUST_Confirmed_102910800'.
Invalid column name 'CREATEDATE'.
Invalid column name 'CUST_Description_102914108'.
Invalid column name 'EDITDATE'.
Invalid column name 'CUST_EndDateTime_102912704'.
Invalid column name 'CUST_Location_102910176'.
Invalid column name 'CUST_Notes_102919193'.
Invalid column name 'CUST_NotesInternal_102913421'.
Invalid column name 'CUST_ParentEntityID_102858929'.
Invalid column name 'CUST_ParentEntityName_102859522'.
Invalid column name 'CUST_PositionInList_102857712'.
Invalid column name 'ISPRIVATE'.
Invalid column name 'CUST_ProjectLead_102905746'.
Invalid column name 'CUST_ProjectName_102904576'.
Invalid column name 'CUST_ProjectType_102905169'.
Invalid column name 'ProjectsID'.
Invalid column name 'CUST_StartDateTime_102912064'.
Exception Target Site: ExecuteNonQuery

---- Stack Trace ----%0A
Stack:0:    Act.Data.CommandProcessor.ExecuteNonQuery(command As Command)
       ActSage.exe: N 00351
Stack:1:    Act.Framework.Database.DefineEntityManagerDB.EntityDeleteEntity(entityId As Guid&)
       ActSage.exe: N 00083

%0A

(Outer Exception)
Exception Source:      Act.Framework
Exception Type:        System.Exception
Exception Message:     Failed to execute 'DeleteEntity' command.
Exception Target Site: EntityDeleteEntity

---- Stack Trace ----%0A
Stack:0:    Act.Framework.Database.DefineEntityManagerDB.EntityDeleteEntity(entityId As Guid&)
       ActSage.exe: N 00184
Stack:1:    Act.Framework.Database.DefineEntityManager.DeleteEntity(entity As CustomEntityDescriptor)
       ActSage.exe: N 00054
Stack:2:    Act.Framework.CustomEntities.CustomEntityManager.DeleteCustomEntity(descriptor As CustomEntityDescriptor)
       ActSage.exe: N 00045
Stack:3:    Durkin.Common.Classes.CustomSubEntity.SubEntityDelete(sEntityName As String)
       CustomSubEntity.vb: line 2364, col 13, IL 0183
Stack:4:    Durkin.Common.Classes.frmEntityDefine.uiBtnCustomViewDelete_Click(sender As Object, e As EventArgs)
       frmEntityDefine.vb: line 0802, col 33, IL 0391

 

Copper Super Contributor
Posts: 59
Country: USA

Re: Error: Failed to execute 'DeleteEntity' command

Hi Guys,

 

I also had this error when trying to delete a custom table. Fortunatelly, this is a database that it's not in the client yet and I had a backup of the database just before I created the custom tables.

 

So each time I want to make a change to the custom tables in the database, I have to restore that backup and create the custom tables all over again.

 

Although I am worried that once the database is live in the client with the custom tables, I have no way to make a change to the custom tables if the client asks for additional requirements.

 

Thanks

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
New Member
Posts: 8
Country: USA

Re: Error: Failed to execute 'DeleteEntity' command

[ Edited ]

Not really sure... what are you passing as sEntityName?

 

If sEntityName is a table.field, is the table a custom table? If it's TBL_CONTACT I don't think it is, and DeleteCustomEntity will probably only lookup and delete custom descriptors.

 

Message Edited by cameronb on 09-05-2008 01:10 PM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Error: Failed to execute 'DeleteEntity' command

sEntityName is the name of a custom entity. The CustomEntityDescriptor is not null because the line of code that's failing is

CommonPlugin.ACTAPP.ActFramework.CustomEntities.DeleteCustomEntity(cDescriptor); 
 

 thanks

-- jim durkin

New Member
Posts: 5
Country: United States

Re: Error: Failed to execute 'DeleteEntity' command

Did you ever resolve this?  I have never been able to delete one.
New Member
Posts: 5
Country: United States

Re: Error: Failed to execute 'DeleteEntity' command

in fact i'd be curious to know if anyone has been able to delete one via the SDK? (perhaps a yay/nay post)
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Error: Failed to execute 'DeleteEntity' command

Please see my posting on for a workaround to this SDK error:

http://www.durkincomputing.com/ACTAddonForum/Default.aspx?g=posts&t=91

 

I have communicated this error directly to the SDK team and have been informed that ACT/Sage is working on a hot fix/patch.

 

If anybody at SAGE wants to chime in that would be nice Smiley Happy

 

-- jim durkin