.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Adjust document permission based on custom property-field (owner person or group)

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :SharePoint

I would like to setup a workflow so everytime a user adds a new document to a document library the workflow adjusts the documents permissions.

I've added a new field to the document library settings which I called "Owner". This field searches persons or groups in the active directory. The person of group that I fill in here has to get contribute-permissions for this document. This process needs to be automatic so I think I have to build a workflow.

Who has got experience with this? Who can help me? Can I do this with the Sharepoint Designer?

The system we use is a sharepoint server WSS3.0

View Complete Post

More Related Resource Links

How to assign values to workflow task person or group custom field?

Using visual studio 2008, in createTask_MethodInvoking, I have the following code. RequestFields has the values from the InfoPath form. ApprovingPersons is a person or group field, added to the task list by my custom task content type. I checked the task list associated with the workflow and I see the custom field.

SPUser user;
SPFieldUserValueCollection fuvc = new SPFieldUserValueCollection();
foreach (Contact person in RequestFields.Persons)
      user = workflowProperties.Web.EnsureUser(person.LoginName);
      fuvc.Add(new SPFieldUserValue(workflowProperties.Web, user.ID, user.Name));

// this is the line causing problem, I believe
PreApprovalTask_TaskProperties.ExtendedProperties["ApprovingPersons"] = fuvc;

I got the following error message:

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argument



Creating a custom column with a link to document (other than the name field) in document library



I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!


How to write an event to manage permissions on a document while uploading, depending on custom field



I am trying to find a solution to manage permissions on a document, while uploading it into a document library. This event has to be fired if a custom field is populated (it's a check box field).

How to write an event for this, i tried writing ItemAdded event, but this is getting fired as soon as a document is uploaded, before coming to the page, where we populate all the fields and hit check in.

can i capture Check-in event.

Please advise.


Activiate Email forwarding with Person Group Picker field

I have inserted 3 person group picker fiels.  I need to set them up so when a user selects a user, it shoots off an email.  I was told that I can set this up in SP designer via a workflow?  If so, can anyone let me know how to set this up properly? Thanks!  Bill KreuderIm a new MS CRM Consultant that is learing all things CRM. Im very excited about 4.0!!!!

SharePoint 2007 to Access 2007 - Issues grouping by "Person or Group" field type/column

We are on SharePoint 2007 and using Access 2007.  The SharePoint list contains a column called Assigned Person, column type: Person or Group, single selection, displaying only the name 1) When we Open with Access and Export a copy of the data, then create a report from that table, we do not have the option to group on Assigned Person.  2) When we Open with Access and Link to data on the SharePoint site, then create a report from that list, when we group by Assigned Person... The same person has 2 groups - there are is no other grouping or sorts on the list, and i can't locate a correlation to another field to show why they would have to collections for the same person The Person or Group column sorts "from smallest to largest" as though it is a number field. The list is a task/activity tracking system we created custom for our needs.  We want to pull a weekly report, grouped by Assigned Person, but cannot get access to work.  We do not want to resort to anything more complex, as it takes a much longer process to have reports pulled by Chrystal or one of those types of applications.  And we cannot change out the field for something like a Choice column as the list already has a very large amount of content.  Can anyone assist? Is there a setting hiding somewhere that is causing the problem? 

How can I get search to work for a Custom Document Library with a few third-party field types?

Hi, Using WSS 3.0 with SQL Server 2008 for Workgroups I have created a Custom Document Library (2,462 files - copied from folder into Explorer view and then renamed using Batch Update in web services i.e. "BaseName" field) - basically it uses three fields that are of "Filtered Lookup" (a field type from a third party). The document library is included in the search (i.e. Advanced Settings), but it displays none of the files - bascially not included in search at all with all testing I have done. I created a new Document Library called "Test" and uploaded a document and it is included in the search. Is there any way I can debug this. Is there a log file? Is there something in the Search Database that might help? Your help would be really appreciated as this is my last issue - and its soooo important to the deliverable. Thanks. John.

Custom user selection in Person or Group type column as per other list.

I have two list in the Sahrepoint Foundation 2010 site. 1) Projects with Title and members(Person or Group - multiple selection) 2) Tasks (Team site default)  - added lookup column Projects form the first list (required) Now I want to assign task given users in the projects list. ex. I have users A,B,C,D,E and Two Project P1 and P2 I have defined that P1 project has users A,B,C so task is distributed/assigned between this members, not to D and E I need some validation or lookup which restrict selection or D and E.   Thank you.  

InfoPath / ActiveX error when using person selector field in Word template off SharePoint document l

I have created an out-of-the-box document library on a SharePoint 2010 site.  I left Microsoft Word Document selected as the Document Template.  I then added a person or group column and a multiple lines of text column to the document library. I then went into Library Settings --> Advanced Settings and clicked on Edit Template, opening the template in Word.  I created my template and added the two new columns to the document.  I did this using the Quick Parts --> Document Property --> [column name] feature under the Insert tab in Word.  I then saved the template back to SharePoint. Upon opening the template or creating a new document from the template, I get the following dialog box: --------------------------- Microsoft Office InfoPath --------------------------- One or more ActiveX controls could not be displayed because either: 1) Your current security settings prohibit running ActiveX controls on this page, or 2) You have blocked a publisher of one of the controls. As a result, the page might not display correctly. --------------------------- OK   --------------------------- I've searched around (I believe fairly extensively) and have not run into anyone else with the same issue.  Some have mentioned a similar error when creating a custom document information panel in InfoPath, and suggested lowered ActiveX security setti

Programmatically creating a Person or Group type field Textbox (similar to 'Assigned To' field in Ta


In our ASP.NET application created with SharePoint object model, we have a user interface with a Contact Person TextBox, we want this TextBox to be similar to the “Assigned To” filed in out-of-the-box Task List where you can search for a particular site user by typing in his/her name. How can we achieve this functionality programmatically?

Thanks in advance………

Taxonomy Field Picker in Custom Webpart Property Panel.


Hi Guys,

How can i Use Taxonomy Field Picker like in Content Query Webpart Property Panel in Custom Webpart.



Thanks Ron

"Person or Group" Field Default Value



I have a "Person or Group" column being used to indicate an Assigned To value for our application. I would like the value of that column to default to the current user's name - in other words, the person submitting the new list item will be the assignee by default (and has the option to change it).


I tried doing this through SharePoint Designer by placing [Me] in some value attributes, but it's not working.


Is there some way to accomplish this?






Person or group field


I am using SharePoint 2010

I have a list contains a person or group field

I choosed to display the user name of the user but i every time it returns with a null value

i want to know what is the issue and how can i display this value

Note :

i already configured the profile synchronization  

Updating Person/Group Field when Current User Clicks Button


Hi all,

Im trying to either add the current user to a multi person/group field or remove them if they are already in the field when they click a button. My code works to decide which button to render on the page - it will show "Add" if the current user is not in the multi person/group field (titled Members) or it will display "Remove" if the current user already exists in the multi person/group field.

My problem is that when the user clicks the button, i want to take the value in the multi person/group field and use XSL string functions to either add/remove the current user to/from the string and push the updated string back into the multi person/group field - This is not working for me. I can reference the correct column with javascript, but it seems the value i get from the person/group column is not just a simple string, its got all sorts of HTML in there. I was hoping just to get a string like, "member1;member2;...). Ive tried changing the field to just display the account (rather than the name with presence), but it still pulls back a huge chunk of code that i cant work with.

Below is my code so far, just to give you an idea - anyone know what im doing wrong?


Custom Choice Field in Document Information Panel


Hello Everybody,

I have created a custom field from SPFieldChoice. My requirement was to customize this custom field in such a way that the dropdown can show items from a specified list.This column type I created specifically for a document library meta data.

I tried to add items to the Choices collection (within the constructor). It seems working fine as I can see the dropdown populated perfectly while uploading documents. But at the same time in the Document Information Panel of the MS WORD, it is not showing properly. What happening is, the dropdown values are not "dynamic". Even if I change the values in my list, the doropdown within the DIP stays same.

Mean time, on the document upload page, it is showing dynamically.

if I remove the column and re-add, it populates again with that instantaneous list items, but remains static afterwards on the DIP.


public CustomChoiceField( SPFieldCollection fields,

Infopath Question: XPath code to remove domain name from AccountID field in Person/Group Picker


I have an infopath email based submission form where I am using the Person/Group picker as a way for people to find people in the active directory to CC the form to. I was using the field "DisplayName" in the control and discovered that when you try to CC several employees, that it would disrupt the rules and you can't send the form.

I want to use the field "AccountID" but it includes the domain before the email alias (for ex. REDMOND\johndoe). Is there a formula code I could use to remove the domain from every email alias. Right now my CC formula is concat(SubmitterAlias, "; ", DisplayName)

Workaround to using "Person or Group" field in a "Calculated" column formula?


Apparently, SharePoint does not allow you to insert a "Person or Group" column into a "Calculated" field's formula.

Is there a workaround to adding a "Person or Group" column into a "Calculated" field's formula?

-Maybe a way of coverting the data from the Person or Group column into a text field, and referencing that text field in the formula?

Microsoft mentions only Columns of the following data types can be referenced in a formula: single line of text, number, currency, date and time, choice, yes/no, and calculated.

Default Value for 'Person or Group' column in a Sharepoint 2010 Custom List



In Sharepoint 2010 I have a Custom List with a column of the type 'Person or Group'.
I would like to have a default name for this 'Person or group' column.
So when a user creates a new list entry and leves the 'Person or Group' column value blank the list entry should be created with the default value für the 'Person or Group' column.

Is there a way to schieve this?

Many thanks in advance.

Roberto Rocco.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend