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

Question

Question

Changing Template Colour using Workflow SDK Script

asked on December 3, 2014

Hi, is it possible to change the colour of a template through the SDK script in Workflow? I know I can get the RGB value of the template colour by using Template.GetInfo to retrieve an instance of TemplateInfo, but want to know if there is a way to set the colour, for instance using Template.Update?

 

Thanks

0 0

Answer

SELECTED ANSWER
replied on December 5, 2014

Yes, it is easy to set the color on a template in an SDK script activity.  Here is a code snippet that will change the 'General' template to something close to Laserfiche orange;

        Protected Overrides Sub Execute()
            'Get a reference to the General template...
            Dim tInfo as TemplateInfo = Template.GetInfo("General", Me.RASession)
           
            'Set the color to something close to Laserfiche orange...
            tInfo.Color = Laserfiche.RepositoryAccess.Common.LfColor.FromRgb(220, 95, 19)
           
            'Persist the change...
            tInfo.Save()

            'Cleanup...
            tInfo = Nothing

        End Sub

The 'FromRgb' method accepts the integer values for red/green/blue and assumes the alpha channel is set to 255.  The SDK documentation also shows that the LfColor object has a 'FromArgb' method that will allow you to specify the alpha channel value as well.

2 0

Replies

replied on December 7, 2014

Works perfectly! Thanks for your help.

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

Sign in to reply to this post.