You are viewing limited content. For full access, please sign in.

Question

Question

Programmatically delete templates?

asked on June 8

Is there any way to programmatically delete templates from a repository. We want to ensure the wrong templates are not deleted by accident so we would rather provide the list to the computer to remove them than have someone manually doing this where they could select the wrong line by accident.

I checked the API documentation but could not find anything.

0 0

Replies

replied on June 9

The API does not currently support it, but RepositoryAccess (aka, the SDK) does. Look at TemplateInfo.Delete method. 

2 0
replied on June 9 Show version history

Is the SDK still documented? I just checked and I don't see the Delete method coming up

I searched the on prem documentation and asked AI. It doesn't seem there is any documentation for the old SDK

0 0
replied on June 10

Here is the basics of deleting a template using SDK

        'get TemplateInfo for desired template
        Dim ti As TemplateInfo = Template.GetInfo(sTemplateName, RASession)
        'ensure the template is not assigned to documents
        If ti.GetAssignedEntryCount = 0 Then
            'mark template for deletion
            ti.Delete()
            'save and delete template
            ti.Save()
        End If

 

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.