How to add User Permissions to form created in InfoPath 2010 created for SharePoint document Library
Hi,
I created a form in InfoPath 2010 with three views (one for user input, the other two views to be used by supervisors) and published this to a SharePoint 2010 document library. Now the way this form is supposed to work is that when a User goes to the document
library and adds a document, it is supposed to open the Form with the User's input view. When the User submits the document, only him/her should be able to open and possibly edit the the form. When the Immediate Supervisor opens the form, it should open in
the Supervisors view and allow them to fill in only their section and not be able to edit or alter the user's data. When the Immediate Supervisor saves the document, the Over-all Supervisor should be able to open it in their view and not be able to edit or
alter the sections filled out by the User and Immediate Supervisor.
How would i go about completing this? I have the views created but now have the problem of associating these views with their respective users or groups.
Hello,
You need to first create user group in sharepoint site then add user in group according to their role. Later you need to call usergroup.asmx web service to get current logged-In user group name so you can switch view and also apply rule for editing or disabling
controls in form.
Follow this link to get group name:
http://social.technet.microsoft.com/wiki/contents/articles/13271.sharepoint-2010-extracting-user-group-of-current-login-user-in-infopath-2010.aspx
http://social.msdn.microsoft.com/Forums/en-US/018f5184-5c83-4a53-b66b-8c376fc800fc/how-to-get-current-users-sharepoint-group-name-sharepoint-2010-infopath-2010
To apply rule on control:
http://office.microsoft.com/en-in/infopath-help/add-rules-for-performing-other-actions-HA101783373.aspx
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help
Similar Messages
-
How to create a managed metadata column in sharepoint document library programmatically
Hi,
I want to create a column of type "Managed metadata" in a document library.
I am new to managed metadata and its basics. So i need to know what it requires to create it. i got this
1. Create a term set Group.
2. Create term set.
3. Create a term.
I am using sharepoint foundation where "Term Store Management" service is not available.
I am writing this code for OFFICE 365. So can write a code with prediction, assuming i have basic info required to run my code?
var termStore = session.TermStores["Managed Metadata"];
var group = termStore.Groups.GetByName("KB Submission Policy");
var termSet = group.TermSets["KB"];
Can write this code with respect to screen shot as follows in my term store
Please reply...Hi,
Please check this
http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2011/08/03/sharepoint-2010-cookbook-programmatically-create-term-sets-amp-metadata-columns-in-managed-metadata-service.aspx
Please remember to click 'Mark as Answer' on the answer if it helps you -
Jquery for sharepoint document library form to filter dropdown/lookup field
I have created a document library to update status of a ongoing process. I have created a lookup column "status" with options
Initiated,
Reivew-in Progress,
Review-Denied,
Review-Approved,
Verification-In progress,
Verification-Denied,
Verification-Approved.
The demand from the client is they want to see - 'Initiated'in the form while adding a new document,other options should be hidden/disabled.
The next time when they edit the form,they want to see just :
Reivew-in Progress,
Review-Denied,
Review-Approved.
Other options should be hidden/disabled.
On the next step they want to see
Verification-In progress,
Verification-Denied,
Verification-Approved.
other options should be hidden/disabled.
I have worked with cascade drop down but i have no idea how to filter a single dropdwn/lookup field.Is there any way to implement this? Any help would be appreciated.
Thank you.Hi Slionel,
Based on you description, my understanding is that you want to show certain fields on NewForm.aspx and hide/ disable other fields and in EditForm.aspx you need to show or hide/disable certain fields based on condition. I would say you can use JSOM to implement
your requirement in NewForm.aspx and EditForm.aspx
based on the condition and requirement, it will be simple and straight forward.
Thanks
Shakir -
Page not found Error while creating new sub folder in the Sharepoint Document Library
Hi All,
I am a site collection administrator when i creating new sub folder under the folder in document library, am getting below error
"Page not found The
page you're looking for doesn't exist."
please help me, Thanks in advance!!
SrinivasHi Srinivas,
Please check ULS log for more useful information when this error occurs.
Please also check if this issue could be reprodued in other libraries, if not, you can use the new library instead.
Thanks
Daniel Yang
TechNet Community Support -
How to add user in administrator group of project server 2010 with powershell command ?
I want to add one user in Administrator group of Project Server .
Please let me know how to do this through power shell command.Hello,
You would need to use the PSI in your PowerShell commands. Here is a .Net example to get you started, convert this to PowerShell:
http://blogs.msdn.com/b/ajjose/archive/2013/05/24/creating-a-project-server-user-and-adding-user-to-a-group-through-psi.aspx
Examples of PowerShell and the PSI can be found here in some of the scripts:
http://gallery.technet.microsoft.com/scriptcenter/Update-Server-Lookup-table-bb1ae14f
http://gallery.technet.microsoft.com/scriptcenter/Create-Server-2010-2013-19bd3cc7
http://gallery.technet.microsoft.com/scriptcenter/Bulk-create-Server-Sites-784f7b29
These wont do what you need but will give you an idea of using the PSI in PowerShell
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS -
How to add user command to drop down list in output screen for OALV Report
Hi Experts,
I have created a report by using OALV.
in Output screen i have added drop down for one filed with 2 values.
when i select value from the drop down list the program should trigger and the next field should be update.
so it is possiable to add a user command for the drop down list in output screen.
if so please help me .
Regards,
RathanHI,
Check the Demo program BCALV_EDIT_06 with having the DATA_CHANGED event still you can capture the changed data. This event will help you.
or you can go for this code..
data: it_f4 type lvc_t_f4,
wa_f4 type lvc_s_f4.
wa_f4-FIELDNAME = 'CONNID'.
wa_f4-REGISTER = 'X'.
wa_f4-GETBEFORE = 'X'.
wa_f4-CHNGEAFTER = 'X'.
append wa_f4 to it_f4.
"register F4 event
CALL METHOD g_alv_grid_ref->register_f4_for_fields
EXPORTING
it_f4 = it_f4.
"Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
"Definition
methods:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
"Implementation
METHOD handle_data_changed .
DATA: ls_mod_cells TYPE lvc_s_modi.
IF e_onf4_before = 'X'.
MESSAGE 'Data changed before F4' TYPE 'I'.
ENDIF.
IF e_onf4 = 'X'. "if event triggered by F4
MESSAGE 'Data changed on F4' TYPE 'I'.
ENDIF.
IF e_onf4_after = 'X'.
MESSAGE 'Data changed after F4' TYPE 'I'.
ENDIF.
"here you know which cell was modified
LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
"just example test case, here you can implement your code for modified cells
IF ls_mod_cells-value >=5.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = 'SABAPDOCU'
i_msgty = 'E'
i_msgno = '888'
i_msgv1 = 'Only numbers below 5 are possibe'
i_msgv2 = 'Please correct'
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id
i_value = space.
ENDIF.
ENDLOOP.
ENDMETHOD. "handle_data_changed
Edited by: sum_it2 on Nov 21, 2011 10:07 AM -
SharePoint Online switching to mobile view when attempting to add user permissions
Hello,
I am having a very weird problem that just started out of no where. It happens when I go to the Site Settings of my site collection and click on Site Permissions. When I click Grant Permissions to try to add users, the browser will immediately switch to
the mobile view.
I am able to switch back to the regular browser view, then when I click Grant Permissions, the box to select the user opens. I then choose the user and click Share. After clicking Share, the popup immediately goes to the mobile view. When I exit that the
users were never granted permissions.
This only happens so far when I am trying to add permissions. Is there something that I could have messed up?
What is happening and how can I fix this? I am out of ideas and unable to add permissions for users. I do not want to have to blow this site collection away.
Thanks.Hi Andy,
According to your description, my understanding is that the page would switch to mobile view when attempting to add user permissions in SharePoint Online.
I recommend to verify the things below:
Clear the caches in browser to see if the issue still occurs.
Test the same scenario in another computer to see if the issue still occurs.
Append mobile=0 to the URLs in SharePoint Online.
In the meanwhile, you can post your question to the forum for SharePoint Online: http://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=onlineservicessharepoint.
More experts will assist you, then you will get more information relation to SharePoint Online.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
How to add users to OSM using UserAdmin.xsd
Hi,
Can you please explain me how to add users to OSM using UserAdmin.xsd i.e xml import/export tool. I need the steps how to do that..
Thanks in Advance,
MenakaHi Razvi444,
You need to use submit data to web service in Submit button rule,where you can use above web service.
Refer http://office.microsoft.com/en-in/infopath-help/submit-form-data-to-a-web-service-HA010107048.aspx more details
Thanks -
How to add user defined tab in the Header level of T-Code O4NM?
How to add user defined tab in the Header level of T-Code O4NM?
I tried with BADI but I cant able to find any BADI for it and also searched for screen exit too..Can you check the user exits,
OIJNOM_N and OIJTKT_N
Cheers,
Balaji -
How to add users from person or group field in a sharepoint list to sharepoint group
Hi,
How to add users(single or multiple) from person or group field in a sharepoint list to sharepoint group programmatically?
Any suggestions would be appreciated.
Thank you,
AA.Hello,
Use SPGroup.AddUser() method to add user in group. I have just written sample code in notepad so it is not tested:
SPSecurity.RunWithElevatedPrivileges(delegate()
using(SPSite Site = new SPSite(SPContext.Current.Site.Url))
Using(SPWeb Web = Site.OpenWeb())
SPList list = web.Lists["ListName"];
SPQuery query=new SPQuery ();
query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Eq></Where>";
SPListItemCollection items = list.GetItems(query);
if(items.Count > 0)
foreach(SPListItem item in items)
//Get USers from person or group column
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString());
SPGroup spGroup = spSite.RootWeb.Groups[groupName];//group name
if (users.Count != 0)
bool isUserInGroup = false;
foreach (SPFieldUserValue user in users)
foreach (SPUser item in spGroup.Users)
string itemUserName = item.LoginName;
string UserName = user.User.LoginName;
if (itemUserName == UserName)
isUserInGroup = true;
break;
if (!isUserInGroup)
spGroup.AddUser(user.User);
The above code will query list item and then get users from "Users" column. Now it will check whetehr user is already in group not, if not then add user in group.
http://rajanijilla.blogspot.sg/2012/09/add-users-to-group-programmatically.html
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to add users to group which is present in another AD domain?
Hi,
Using JNDI how to add user as a member of group which is present in another AD domain?
For example: In AD forest test.com their are two domain a.test.com and b.test.com. Group is present in a.test.com and I want to add user present in b.test.com as a member of the group.
Any pointer around this would be great help.See the below link to get an idea on group types.
http://technet.microsoft.com/en-us/library/cc755692(v=ws.10).aspx
If the group is a universal group, you can just add members similar to local group even if user and group are in different domains. That is by setting the member attribute of the group. -
Easy Question: How to identify user roles within form?
Hi folks,
I would like to display/hide button which calls static data maintenance form (from other form) based on current user roles.
If user has role "STATIC_DATA" granted then DISPLAY button (which calls static data form), else DO NOT DISPLAY it.
Any example, how to get user roles within form?
Thanks,
TomasI can do it with below code:
declare
l_cnt number;
begin
select count(*)
into l_cnt
from user_role_privs
where granted_role = 'STATIC_DATA';
if l_cnt > 0 then
-- display it
else
-- do not display
end if;
end;I think, above should work.
Thanks,
Tomas -
Upload a document from a form into a SharePoint document library
The idea is that I have a form which I want to allow users to upload files into my SharePoint document library. I am just not just what to do after the 'HasFile' Statement. Some small snippets of my code below. I am just not sure how from the fileupload ID
to get it into my document library. Please provide code.
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
Server side code
protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)protected
void
Button1_Click(object
sender,
EventArgs
e)
if
(FileUpload1.HasFile)
// Assuming you have list current context. Or else get reference to the list instance from the parent SPWeb var list
= SPContext.Current.List;
list.RootFolder.Files.Add(FileUpload1.FileName,
FileUpload1.FileBytes).Update(); -
How to filter the Files from SharePoint Document Library based upon cloumn value
Hi
I should filter the files from document library. I have column called "Print Status" for the document library the value would be either "Yes" or "No".
Now i should filter out the files which has "Print Status" as a "Yes".
I am using SPFolder and SPFile from SharePoint Object Model to traverse the file in doc library.
How could i do it?
My Sample code:
foreach (SPFolder childFolder in folder.SubFolders)
if (childFolder.Name != "Forms")
AspControls.TreeNode trn = new System.Web.UI.WebControls.TreeNode(childFolder.Name, "", "~/_layouts/images/itdl.gif", childFolder.ServerRelativeUrl.ToString(), "");
newNode = TraverseFiles(childFolder, trn);
// add the new node to the tree
rootNode.ChildNodes.Add(newNode);
// loop through the files
foreach (SPFile childFile in folder.Files)
// create a new node and add to the tree
AspControls.TreeNode childNode = new System.Web.UI.WebControls.TreeNode(childFile.Name + " (" + childFile.TimeLastModified.ToShortDateString()
+ ")", Convert.ToString(childFile.Item["ID"]), "~/_layouts/images/" + childFile.IconUrl, childFile.ServerRelativeUrl.ToString(), "");
rootNode.ChildNodes.Add(childNode);
Thanks
Poomani Sankaran.Why do you transvers the file an not use a camp query? In a CAML query you can filter the print status and are able to get all files and folder objects at once.
Check out the following post: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c45b5e2-1fb8-435c-a97d-1d8c6d288d4c/caml-query-to-query-all-the-files-and-folders-in-document-library?forum=sharepointdevelopmentprevious
Kind regards
Stefan
http://www.n8d.at/blog
Follow me on Twitter: StFBauer |
n8design
Microsoft Community Contributor 2011 / 2012
MCTS - SharePoint / WSS Configuration and Development -
Creating a folder for a document library in SharePoint online
Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.
Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
Now you'll combine bits from both of these scripts:
1. Connect to SPO
2. Get your list (looks like you need to first get the site collection and then the site)
3. Create a folder
I figure it would look something like this (note I haven't tested this at all):
#Specify tenant admin and site URL
$User = "[email protected]"
$SiteURL = "https://tenant.sharepoint.com/sites/site"
$DocLibName = "DocLib"$FolderTitle = "Example Folder"
#Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$Password = Read-Host -Prompt "Please enter your password" -AsSecureString
#Bind to site collection
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
$Context.Credentials = $Creds
#Retrieve list
$List = $Context.Web.Lists.GetByTitle($DocLibName)
$folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
$folder["Title"] = $FolderTitle
$folder.Update();
Jason Warren
@jaspnwarren
jasonwarren.ca
habaneroconsulting.com/Insights
Maybe you are looking for
-
Need help with e4x syntax for children in ADG TreeView column
I would like to display Hierarchical XML data as a treeView in a ADG control. I can bind the first (parent) level of my XML to the ADG using a HierarchicalData Dataprovider, but I can't figure out the syntax to get the children. The attached code sho
-
Thinking of giving up BT TV as it's not fit for pu...
Just a month ago i reported trouble with my BT youview box and the blocking / freezing with the box putting up messages banner that signal is bad and code ipc2063 ...BT did reply to this and it took a few days to fix a network performance and for abo
-
7d Mark II with a 1.4x teleconverter -- WOO HOO!!!!
So, just a couple of weeks ago, I found myself in an interesting position -- let me explain. I had a 60D that I had loved for the past 3 years. But......I have a 100-400 f4-5.6L that I also love. BUT, I also have a 1.4x teleconverter that I occassi
-
Exporting - Option for Best Quality?
Okay. Just upgraded to QT Pro. What "export" option produces the best quality video? Also, should QT Pro be able to open an WMV file? I've been having to use Flip4Mac, but is water marks everything when I try to do the conversion to *.mov format. Tha
-
Hello, and thanks in advance for taking the time to give this a look. (TL;DR below) As stated in the topic title, I've been having issues with my PC involving POST beep codes. Couple days ago, PC stopped displaying on monitor. A few on/off's later, I