Tuesday, January 11, 2011

Conditional Formatting-SPD

Recently I got a requirement to set Permission at Field Level which is not available in MOSS Out of box.Then got to know about conditional formatting in designer which solved my purpose.

I have just detailed the steps below:

Open SharePoint Designer and you will find Conditional formatting under Data View tab.
Click on Create. You will find three options as below



In this Post,we will how to  Show Content/Hide Content based on the User Roles. For instance, I wanted to make Status field in the below list to be visible only to users with Full control access in customized Edit Form



To achieve that follow the below steps
Click on Show content and then on Advanced


Select IfHasRights and double click on it and add ‘9223372036854775807’ (This is the permission mask for Full control).


Browse to the list and edit item with users other than Full control and you will see the Status column is not visible.


In the same way you can show/hide fields based on the user roles or other column values.
Permission Mask for other Roles:
ViewListItems – 1
AddListItems – 2
EditListItems – 4
DeleteListItems – 8
ApproveItems – 16
OpenItems – 32
ViewVersions – 64
DeleteVersions – 128
CancelCheckout – 256
PersonalViews – 512
ManageLists – 2048
ViewFormPages – 4096
Open – 65536
ViewPages – 131072
AddAndCustomizePages – 262144
ApplyThemeAndBorder – 524288
ApplyStyleSheets – 1048576
ViewUsageData – 2097152
CreateSSCSite – 4194314
ManageSubwebs – 8388608
CreateGroups – 16777216
ManagePermissions – 33554432
BrowseDirectories – 67108864
BrowseUserInfo – 134217728
AddDelPrivateWebParts – 268435456
UpdatePersonalWebParts – 536870912
ManageWeb – 1073741824
UseRemoteAPIs – 137438953472
ManageAlerts – 274877906944
CreateAlerts – 549755813888
EditMyUserInfo – 1099511627776
EnumeratePermissions – 4611686018427387904
FullMask – 9223372036854775807