Skip to main content
17-Peridot
June 17, 2021
Question

Difficulties in deleting project

  • June 17, 2021
  • 1 reply
  • 1780 views

When I tried to delete Project it showed, "Cannot delete project 'xx' since it is referenced by one or more entities".

 

So tried to delete all the entities using the custom service below: Now getting this error while executing the service, "Error executing service trialdeletingentities. Message :: Cannot Delete This Entity - It Is Referenced By 3 Other Entities - See Script Error Log for more details."

Now what are the other ways to delete the project.?

 

var params = {
infoTableName : "InfoTable",
dataShapeName : "EntityReference"
};
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

result= Projects["XXXXX"].GetEntities();
for( var i=0;i<result.length;i++)
{
if(result[i].type=='Thing')
{
Resources["EntityServices"].DeleteThing({
name: result[i].name /* THINGNAME */
});
}
else if (result[i].type=='Thing Shape')
{
Resources["EntityServices"].DeleteThingShape({
name: result[i].name
});
}
else if (result[i].type=='Thing Template')
{
Resources["EntityServices"].DeleteThingTemplate({
name: result[i].name
});
}
else if (result[i].type=='Media')
{
Resources["EntityServices"].DeleteMediaEntity({
name: result[i].name
});
}
}

 

1 reply

15-Moonstone
June 17, 2021

@AP_9587236 : Which version of thingworx are you using? If you open the project in composer , there you can see the entities which are present for the project . You can delete the entities from here and do not require any custom service .

abjain_0-1623920380221.png

 

17-Peridot
June 17, 2021

The version is 8.4.2. There are more than  700 entities in a project. During import, only 400 entities imported. Due to this presence of incomplete project, Source Control import is getting failed. So i need to delete this project to proceed with the source control import.

Support
June 23, 2021

Hi @AP_9587236 

 

Is it possible you failed to install a required extension prior to attempting the import?  Have you checked the Application and Error logs for the dependencies that are missing to ensure a successful import?

 

If you're unable to make any progress, if you have support, we can open a support case so an engineer can assist.

 

Regards.

 

--Sharon