cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Difficulties in deleting project

AP_9587236
17-Peridot

Difficulties in deleting project

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
});
}
}

 

3 REPLIES 3
abjain
13-Aquamarine
(To:AP_9587236)

@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

 

AP_9587236
17-Peridot
(To:abjain)

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.

slangley
23-Emerald II
(To:AP_9587236)

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

Top Tags