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

Question

Question

Remove a Template from a Document?

SDK
asked on June 25, 2014

In .Net code, how do you remove a Template from a Document or set it to "No template assigned"?

 

I know how to assign a template, like this -

Dim LFTemplate As ILFTemplate = ActiveRepository.GetTemplateByName(sTemplateName)
fieldData = lfDoc.FieldData
fieldData.Template = LFTemplate
fieldData.LockObject(Lock_Type.LOCK_TYPE_WRITE)
fieldData.Update()

But how do you take off any existing template?

Thanks!

0 0

Answer

SELECTED ANSWER
replied on June 26, 2014

In LFSO you set the Template to nothing.

fieldData.Template = Nothing

 

1 0

Replies

replied on June 26, 2014

Hi Howard,

 

You can use the RemoveTemplate method (part of the EntryInfo class) to remove the current template assignment.

 

Another thought: don't forget about the power of Workflow! I'm not sure what you're working on here, but Workflow makes removing templates easy. If you build whatever you're working on as part of a workflow, you could take advantage of all the built in functionality, and only have to script the stuff that isn't already there.

2 0
replied on June 26, 2014

Thank you Brett.

I guess there's no function using LFDocument?

 

I'd appreciate if you could tell me Laserfiche keep samples of EntryInfo?

 

0 0
replied on June 26, 2014

Nice.  Thanks Bert!

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

Sign in to reply to this post.