Hello! I'm trying to programmatically set user attributes to control which columns are displayed to any given user in the thick client. I'm doing this through an SDK script that runs within a workflow.
Defining and setting the attributes is working great for me, using the following code:
'Get the user's name. Dim username as String = Me.GetTokenValue("RetrieveLaserficheFormsContent_Username") 'Get the IDs of folders used in attributes. Dim activeOrdersFolderId as String = Me.GetTokenValue("GettheActiveOrdersFolderID_OutputEntry_ID") Dim archivedOrdersFolderId as String = Me.GetTokenValue("GettheArchivedOrdersFolderID_OutputEntry_ID") 'Define the column layout attibute. Dim columnLayoutAttributeName as String = "[XmlColumnDisplay]Data" Dim columnLayoutAttributeValue as String = "<?xml version=""1.0"" encoding=""UTF-8""?> <columndisplay generatedby=""Laserfiche Client 9.2.1.635""> <layouts> <layout id=""5""> <columns> <column ColCode=""N"" SortOrder=""A"" SortPriority=""1"" Type=""System"" Width=""300"" /> <column ColCode=""D"" Type=""System"" Width=""81"" /> </columns> </layout> <layout id=""16""> <columns> <column ColCode=""N"" SortOrder=""A"" SortPriority=""1"" Type=""System"" Width=""292"" /> <column ColCode=""Current Gate"" Field=""Current Gate"" Type=""Field"" Width=""136"" /> <column ColCode=""Zeno Office"" Field=""Zeno Office"" Type=""Field"" Width=""71"" /> <column ColCode=""Sales Rep"" Field=""Sales Rep"" Type=""Field"" Width=""103"" /> <column ColCode=""Amount"" Field=""Amount"" Type=""Field"" Width=""83"" /> <column ColCode=""Lease"" Field=""Lease"" Type=""Field"" Width=""40"" /> <column ColCode=""D"" Type=""System"" Width=""53"" /> </columns> </layout> </layouts> <folders> <folder id=""1"" layoutid=""5"" /> <folder id=""3"" layoutid=""5"" /> <folder id=""1051"" layoutid=""5"" /> <folder id=""18"" layoutid=""5"" /> <folder id=""515"" layoutid=""5"" /> <folder id=""" & activeOrdersFolderId & """ layoutid=""16"" /> <folder id=""39982"" layoutid=""5"" /> <folder id=""40005"" layoutid=""5"" /> <folder id=""" & archivedOrdersFolderId & """ layoutid=""16"" /> <folder id=""520"" layoutid=""5"" /> <folder id=""2774"" layoutid=""5"" /> </folders> </columndisplay>" 'Define the "unique folder columns" attribute. Dim uniqueFolderColumnsAttributeName as String = "[Settings]UniqueFolderColumns" Dim uniqueFolderColumnsAttributeValue as String = "Yes" 'Set attributes on the user. Dim attributes As TrusteeAttributeCollection = Trustee.GetAttributes(New AccountReference(username, Me.RASession), Me.RASession) attributes(columnLayoutAttributeName) = columnLayoutAttributeValue attributes(uniqueFolderColumnsAttributeName) = uniqueFolderColumnsAttributeValue attributes.Save()
This all works great, except for one minor thing...
Let's say that the XML above sets the column layout on Folder X. And let's also say that Folder X has a bunch of sub-folders inside of it. In this example, when a user browses to one of the sub-folders inside of Folder X, the Laserfiche client automatically modifies the XML within the `[XmlColumnDisplay]Data` attribute, so that the child folders will inherit the parent folder's column layout.
Is there any way to prevent this? In my scenario, the column layout only makes sense for Folder X, not for its children. Thanks!