Set field via URL - sharepoint

Is it possible to have a field in the current item be changed by clicking a URL? The field would be a choice field with predefined choices.
Such as if the item field is currently:
Status: 2
If a user clicks the link, the field would now be:
Status: 3
If not, is there any other way for a user to easily change a field in the current item without actually haveing to visit the item?
Thanks!

Not Out Of The Box (OOTB) - but you've a few options.
Write an ASPX page to do what you want
Use something like SPServices and javascript to update the list item via the web services.
Use the Client Object Model (2010 only)
By the way - changing stuff on a 'get' can be dangerous as you can do malicious things - for example imagine you have a page that deletes the users account without any prompting (exact example doesn't matter) - what if someone clicks on that link by mistake or even worse what about an email sent with an image with that page as source URL - simply viewing the email could delete the users account.

It's not possible by using a GET request, but SharePoint 2010 is offering a RESTful API to manage ListItems from any client
The REST API is located within the virtual WebServices folgder under each SharePoint Site.
http://YourSharePointSite/_vti_bin/ListData.svc.
To perform an update on SharePoint ListItems you have to create a PUT Request. For more information on SharePoints REST API you should have a look at this MSDN site, there are also a lot of samples linked from this article.
Thorsten

Related

Externally hosted form and NetSuite Data

I have a page hosted on an external site and I would like to create a form on that page. The use of the form would be to collect data to create SO in Netsuite.
In the form itself, I would like to have an autopopulate functionality so that for e.g. when I put in "Kat" in End User contact, I see all contacts starting with "Kat". This will enable me to select a correct contact and also help prevent duplication of data. Can you please guide me on how to structure this flow. What Netsuite components should i be using? For the external site, it will use Django.
Thanks
You need to create a couple of RESTlets in NetSuite. One to perform a search to get the contacts and return them in the payload, and one to create sales order in NetSuite and populate it with the values provided in the payload.
How are you solving the issue with CORS?

How to view standard objects in salesforce online?

there are many standard objects e.g. AccountcontactRole, LetterHead, Approval etc. which can be retrieved using Salesforce APIs. What is the way to see these objects in Salesforce environment in browser?
Very roughly speaking - easiest cheat is to simply put the Id in the URL. So if your Salesforce instance is https://na1.salesforce.com then adding /001.... (any valid Account Id) will take you to this account. Similarly /016... will take you to "this" Letterhead record.
Some data is easily accessible to users - for example AccountContactRole should be available as related list under Account. If it isn't - probably the administrator removed it from page layout because the company decided to use only the straightforward Account - Contact relationship.
Some data like Letterheads, EmailTemplates, Approval processes is visible in the setup area (not all users have the "View Setup and Configuration" permission in their Profiles!)
*Share records (like AccountShare) would be visible after you click the Sharing button on the page layout (if it's not visible - again, check with Admin).
If you're using API to fetch the data, you probably can also use "describe" calls to fetch info which objects are available, what fields are present in the tables... Sometimes the "Frontdoor URLs" property is set (although I confess I'm not sure how to get it, http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_Schema_DescribeSObjectResult_instance_methods.htm doesn't mention it).
Also - if you haven't noticed yet - all Accounts start with "001". Try to guess where "/001" and "/001/o" links would lead.

Is it possible to autocomplete fields in Sharepoint with user info?

I'm in charge of a Sharepoint collection, and a user asks this. Is it possible that when a user creates an item, some fields are automatically filled with some info, such as email address and location?
Authentication uses Active Directory, so every user is identified when using Sharepoint. The only issue is that, being in a big corporate company, I don't have any access to the server, so it must be feasible through configuration of said site/list or using Sharepoint Designer, but I can't and won't be allowed to deploy anything server side.
Any idea?
With your limitations, your best bet would be a combination of ajax (I suggest jquery) and sharepoint webservices (if necessary), you need to do a XmlHttpRequest in the userdisp.aspx page, if this page has all the info you need, then get it, otherwise, get the currently logged account and use it to query the webservices (this part I'm not sure if theres a method that will return this info).
This all works using only the browser (Content Editor WebPart) or the SharePoint Designer client.

How to allow Users to request access to a particular document in SharePoint?

I would like to create something in SharePoint that allows users to request access to particular documents and then for me to be able assign access for a period. Would this be possible in SharePoint? If so, how would i go about doing this? What must i use?
Thanks in advance!
Set up a SharePoint Group for those documents and then allow users to request membership to the group.
This is how I would do it:
Add a hyperlink column to the Document Library
Add a 'New Item' event handler to the DL which adds the url to the hyperlink column, and point the hyperlink to your own ASP.Net page (or even the DL itself), with details of the document required (ID et al) in the GET string. Call this hyperlink 'Request Access' or something similar.
Create a webpart which checks the GET string for the right variables, identifies the user (currently logged in user viewing the page the webpart is on) and sends you an email informing you of the request. Add this webpart to the target ASP.Net page in step 2.
When a document is added, the event handler will update the hyperlink column with the required hyperlink. When a user requires access, they will click on the properly formed hyperlink, which will take you to a page with the receiver webpart on it. The receiver webpart will get the required information from the GET string, inform you via email, and also inform the user that the request has been received.
Although I'm sure theres a better way to do this...
You can modify the "popup" menu that's shown while hovering over the document. Add a link to that menu, here's an example of how to change the hover menu:
www.articlestreet.com/computers/send-a-sharepoint-document-library-file-as-email.html

How can I validate within an InfoPath form whether a user exists within a SharePoint Portal?

I am creating a form within InfoPath which is to be integrated into a SharePoint 2007 Portal. Within this form there will be a textfield into which a user can enter the Name of a Person.
How can I validate whether this Person exists or not?
Instead of validating the user, is there a way to fill a dropdown List with all usernames of the portal? (which of cause would be users from the Active Directory)
I haven't done this specifically, so there may be a better way, but I've been pulling a lot of data out of SharePoint and into an InfoPath Form (deployed to a SharePoint forms library and accessible through SharePoint Forms Service with MOSS Enterprise) and also going the other way using the SharePoint web services - very quick to use, and the person web service is right there.
Have you tried looking at the Contact Selector (an ActiveX control). Here is a MSDN-article describing how to add it as a control in InfoPath and this one describes how to make it work.
I have been using it in the majority of my infopath projects and it works flawlessly - also for browser-enabled forms.
When doing something similar in an ASP.NET application, I've used the Sharepoint search and searched the "People" Scope for the specific user. You can also search across profile information so you can pull back everyone with a certain Job Title, or in a specific Department.
I don't validate a person's existance, but I do determine a person's full name using their login and SharePoint. You should be able to modify this code for your purposes, it is below. For it to function you need a data connection in your InfoPath document called GetUsersFromSP. Configured as follows:
Location is - http://njintranet2/_vti_bin/usergroup.asmx?WSDL
Operation is – GetUserColectionFromSite (last one on list)
Automatically retrieve data when form is opened should be checked.
string ADName = System.Environment.UserName;
IXMLDOMDocument3 UserQuery = (IXMLDOMDocument3)thisXDocument.GetDOM("GetUsersFromSP");
UserQuery.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" " +
"xmlns:tns=\"http://schemas.microsoft.com/sharepoint/soap/directory/\"");
((WebServiceAdapterObject)thisXDocument.DataAdapters["GetUsersFromSP"]).Query();
IXMLDOMNode Users = UserQuery.selectSingleNode("//dfs:myFields/dfs:dataFields/tns:GetUserCollectionFromSiteResponse/tns:GetUserCollectionFromSiteResult/tns:GetUserCollectionFromSite/tns:Users");
foreach (IXMLDOMNode current in Users.selectNodes("tns:User"))
{
string Login = current.attributes.getNamedItem("LoginName").text;
Login = Login.ToUpper();
if (Login.EndsWith(ADName.ToUpper()))
{
thisXDocument.DOM.selectSingleNode("my:root/my:config/my:User").text = current.attributes.getNamedItem("Name").text;
break;
}
}
Use this control:
http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx
Or if you want to build your own validator, you'll need to query the SharePoint profile database. I'd recommend this over querying AD directly. There's lots of articles online about working with the profile database.
Have a look at this Link, it explains how to populate a dropdown with the SharePoint Users
http://blueinfopath.blogspot.com/2008/10/how-to-populate-list-with-sharepoint.html
I you want to validate,
- Make a textbox
- Add a Button, name it ValidateUser
- Create a Receive Connection to the ......
- Att Rules to the ValidateUser
- Add the textbox to the field AccountName in the Secondary Datasource
- Execute the receive connection
- Get the value of the field Value with filter Name="PreferredName"
This work for Infopath Form Services
Test it and enter the UserLogin into the textbox and click on the Validate Button
Frederik

Resources