I'm managing a Sharepoint list, which is holding all our changes made in our last software iteration. Among the fields are a few pertaining to the testing process, for example a 'Testing Result' dropdown (possible values Ok/Not Ok/Todo).
I've successfully set up a Sharepoint Workflow, which assigns a "Please test this" Task to the developers, when someone sets this 'Testing result' to 'Not Ok'. This works nicely, but I would like to add some fields from the List to the Task title, to let the developers know which item they actually need to re-test.
Is this possible? I'm using Sharepoint Designer for this (it's a Sharepoint 2010 workflow)
This is possible if you create a variable and build up a string and then assign it to the Title.
you string can be made up of static text, other workflow values and fields from the list you are working or from somewhere else in the site.
Found this myself, you can add all necessary fields if you use the action 'Custom Task Process' instead of simply assigning a task.
Related
I am new to SharePoint. I'm creating a workflow in SharePoint 2013 in which I want to iterate a List using a loop.
How to perform looping through list items in SharePoint 2013 Designer Workflows?
I'm not aware that there's any out-of-box way to get a workflow to "loop through" all entries in a list, but you can try to make two workflows bouncing back to each other until all entries are updated, here is the detailed steps,
assuming that the list that we are working on is named list_work, in this list, create a column named e.g. cargo
define another list, name it e.g. list_control,
define a column named e.g. listID,
define a column named e.g. cargo,
create one entry in the list, set the cargo to a value.
define a workflow, name it e.g. workflow_list_control, which is triggered every time the entry in list_control is updated, and in this workflow,
search for an entry in the list_work where the list_work.cargo doesn't equal list_control.cargo
if any entry is found, update the entry of list_work and set the list_work.cargo with list_control.cargo, in order to trigger the workflow_list_work (see #4 below)
if no entry is found, stop this workflow.
define the workflow that needs to be run on the list_work, e.g. named workflow_list_work, make it's triggered every time the entry in list_work is updated, and in this workflow, make sure it updates the only entry in the list_control with the ID of the entry from list_work that is being modified, only to trigger the workflow_list_control. In this step, try to put a workflow step to wait and verify the ID is properly updated, in order to allow enough time for the previous workflow_list_control properly finishes.
Every time if a looping-through is necessary, modify the entry in list_control with a different value in the cargo field.
Also refer to calculated-column-to-retrieve-total-number-of-id
You can do this in SharePoint 2013 (ONLY!) using the new "HTTP web service". The "trick" is to
Create a task that will call the HTTP Web Service and call ".../client.svc/web/lists/getbyid(<List Guid>)/items"
Return the (JSON) results in a (new in 2013 also!) "dictionary" variable
Use the "Get an Item from a Dictionary" action
"item by name or path" and enter "d/results"
select the "dictionary" variable (that you captured the results in)
output to another dictionary variable (call it "data")
Then get the count (for the loop) by using the action "Count Items in data" and output that to a variable (totalItems) to get the number of records
For the "loop" you will use the "Loop with condition"; use a variable called "index" and set it to 0. "Loop with condition" until "index < totalItems"
In the body of the loop:
"Get an item from a dictionary" use "item by name or path"
using string builder "d/results/(<index>)/".
The "Column Name to Retrieve" will be whatever column(s) you want to evaluate (like maybe "DueDate").
Note: You will have to use the "Static Name" of the column, which can be found by going to the Task List Settings and clicking the name of the column, then in the URL find the "Field=<Name>" portion.. It is that "<Name>" that you will use.
I know this is very CRUDE maybe even bordering on "useless" for alot of users, but I felt I should at least attempt a quick reply. When I have more time, I will try to edit this and format my reply better. Although, I found this because of a similar need and since I figured out a way to accomplish what I was needing, I felt compelled to at least share it the best I could, in the limited time I had available. ;) So, maybe SOMEONE will find what I have attempted to describe, "useful". :)
We have a list with 1000+ phone numbers in it. This list is sorted in a specific order by due dates and other criteria. This order is very important and needs to be maintained in the solution.
We have a group of callers (roughly 4) that will be calling the numbers in this list in the order they are sorted by. These callers are to be presented with one list item at a time, via an InfoPath form, and once they make the call they will update the list item and be presented with the next list item dictated by the sort order.
Here's the problem: This would be very easy with 1 caller but with 4 callers we don't want them calling the same people more than once. So they need grab the next list item off the top of the pile that isn't already taken by another caller.
Is there a way to build a webpart (remember without Visual Studio unfortunately) that as soon as it loads would find the first list item that is unassigned and assign it to the current user?
We could accomplish this whole thing manually of course by having an admin assign all the calls each day with a large copy/paste in Datasheet View but automatic would be soooo much better.
I will mention that I DO NOT have Visual Studio so I don't have that as an option here. But I do have SharePoint 2010, SharePoint Designer 2010, and InfoPath 2010.
I hope this makes sense and any ideas, thoughts, approaches would be greatly appreciated since I've run out! Thanks!!!!!
You can develop SharePoint web parts using Visual Studio Express, but its a bit harder as you miss some of the tools that make your life easier like WSPBuilder etc.
SO - Building webparts with Visual Studio 2010 Express
Another alternative would be to use javascript client side to access SharePoints Web Services via SPService - then nothing more than notepad is required.
You're really using a wrench as a hammer with either of these approaches though, so I've got to say - how much do you value your time at? ;)
I can offer a very bodgy alternative; presuming all the items are added piecemeal (not in the same second). You could add a calculated column to assign each item at random on addition, using the following formula:
CHOOSE(MOD(SECOND([Created]),4)+1,"Operator1","Operator2","Operator3","Operator4")
I suggest a workflow that is assigned to listItem's edit; that when a caller edits its extra field like "Operating(bool)" after the calling workflow completes; the item is disabled somehow.
Only overhead of this is a caller needs to edit the item every time.
But the easy part is a listviewer webpart (oob) can be used just with a default view setting like "Operating" field is "false" only.
This is simple. On form load, instruct the form to update a status field to (let's say 'assigned') and automatically resubmit the form back. Your infopath list that pulls in the next number to call would need to exclude any that are in the assigned status. You'd also need to re-query your data connection to refresh the list each time before a call is made to grab the next available. Once the caller is finished, they can click a button that submits the form, clears the status field and closes the form.
Yo can also pull in the active items into an infopath form using a secondary data connection. There is a way to use the insert hyperlink into the form field, and make any of your fields a URL hyperlink directly to the individual item. Although you'd have to have the URL epsaved in a field in the form the item was created in. That's easy to do, you can just con at the URL with the form name.
I'm a coldfusion developer, and I've been asked to rewrite a coldfusion application for SP 2010. I have no SP experience, but I'm now the SP admin.
My application is a waiting list for customers that enter a service center. The customer is entered into a List that tracks the following:
Name
Location (drop-down list of physical store locations. no multiple/custom values)
Check-In Time (timestamp for when customer was added to list)
Service Required (drop-down list, not allowing multiple or custom values)
Staff Member Requested (option, user select box)
Time Seen by Staff (timestamp when list item edit begins)
Seen By Name (name of user that edited record)
Time Finished with Staff (timestamp when list item edit is saved)
There are a few pieces of functionality that I don't know how to build into this list.
1
The records on the list view must be automatically filtered by the location column. The location to be viewed should be based upon the users group membership. (one group per location)
The Time Seen date/time field must be a timestamp that occurs when the list item is opened for editing.
The Seen By name must be automatically entered when when the user opens the list item for editing.
The Time Finished timestamp must be automatically entered when the user saves the list item after editing.
I don't expect anyone reading this to create this for me, but I would truly appreciate any tips, suggestions, or tutorials you can point me towards that will help me to accomplish these goals.
You will have to create such a list with the SharePoint Administration. You have several possibilities to do this. You can build them in you web browser using your SharePoint Site with the necessary rights, you can use the Microsoft SharePoint Designer (similar, less functionalities but in my opinion easier to use) or you could deploy the list after you built it in Visual Studio (best solution if you want to deploy it on more than one server or you want to change your list afterwards, but difficult).
There are some things you have to know: A list manages one or more content types. A content type is a collection of columns that contain the types (and more information) of your data. There are templates for content types and columns, but you will have to create your own content type and maybe some new columns as the templates might not be enough for your demands.
I'm not sure how to manage your first point. There is definitely a solution but I'm beginner, too.
The other 3 points could be managed by workflows: You can define workflows for a list, that do things after an item of your list is created or edited. I'm not sure if this will be useful for your 2nd point.
Another possibility would be to build a webpart, but that wont be a solution for a coldfusion project as I think. In a webpart you could handle all the interaction that are made by an user and change your list item individually.
A third way is to build an event receiver (using Visual Studio) for your list, but then you would have to build your list with the help of the VS as well.
I'm sure that won't answer all your questions but I hope you have some directions that you can inform about.
I have a list (assume an issues list) and there is a workflow associated with it. The workflow can adjust the status column of the item to "Closed". Once an item's status is closed, I want to make it read-only so that noone can edit the item or create another workflow instance for that item.
What's the best way to achieve this?
There are item-level permissions that can be set, so you can override list-level permissions on an item-by-item basis. Adding this functionality into your existing workflow probably makes the most sense, but of course there is nothing out-of-the-box that SharePoint provides you.
Luckily, you can extend SharePoint's workflow by creating your own custom actions. The process for doing this in SP2010 is fundamentally the same as 2007; check out this MSDN tutorial for an overview of the process.
There is also a convenient package of custom activities provided in an open-source product called SPDActivities at CodePlex. Specifically of interest to you is the Grant Permission on Item activity. Even if you opt not to use the whole package, you can examine the source code and see about implementing your own version of it (I did something similar for a past project).
Once you have a workflow action for setting an item's permission level, simply add a step to your existing workflow to set Read permission for the affected audience or group.
Have you looked at SPUtility.js? You could get the value of your status field, and then if it is Closed, make the other fields read only (or hide them). This is done using JavaScript that is added in a content editor web part on your EditForm.aspx.
var myChoiceField = SPUtility.GetSPField('Single Choice Field');
if (myChoiceField.GetValue() == 'Closed') {
SPUtility.GetSPField('Field A').MakeReadOnly();
SPUtility.GetSPField('Field B').MakeReadOnly();
SPUtility.GetSPField('Field C').MakeReadOnly();
// etc..
}
Full disclosure.. this is an open source library I maintain. I've tested it with SharePoint 2007 only, but it may also work with SharePoint 2010 (unfortunately I don't have access to a SharePoint 2010 environment to test).
I would attack it one of two ways:
Once the workflow completes and sets the item to Closed, you can break the permissions inheritance from the parent list and set the list item permissions to read only. You could do this within a custom workflow or as either a Workflow or List Item event receiver.
Have an ItemUpdating List Item event receiver that sets properties.Status = SPEventReceiverStatus.CancelWithError if status is Closed.
Personally, I like the first option better as it fits in with SharePoint's security philosophy of not letting the user attempt what they do not have permissions to do. The following code is an example of setting read only permissions on a list item:
item.BreakRoleInheritance(false);
SPRoleDefinition role = web.RoleDefinitions.GetByType(SPRoleType.Reader);
SPRoleAssignment assignment = new SPRoleAssignment(web.AssociatedVisitorGroup);
assignment.RoleDefinitionBindings.Add(role);
item.RoleAssignments.Add(assignment);
Try creating an Event Receiver and handle the deleting event.
Idea (un-tested): Add a custom content type to the list (this will allow you control to edit as an admin later). Have workflow switch to the custom CT one the item is "closed". Add a read-only view of the item data to your EditForm.aspx, and in Designer add class "hidden" to your read-only view. Then add custom css in a CDWP on the page for class .hidden display:none. Then use JavaScript to add/remove that class based on the CT, so that the read-only view is only visible for the custom CT, while the edit wp is visible for all others.
Or use a custom InfoPath form to switch to read-only view based on status...
We use Sharepoint Services 3.0 as a project tracking tool. We have a list set up that contains your basic information (description, etc.) plus we have a "assigned person" column that is of type Person or Group that we use to associate list items with individuals. This column supports multiple selections.
We would like to set up alerts such that each person gets an alert email only if they are assigned to a list item. The approach we have taken is to set up a view on this list that is filtered to show list items where the assigned person equals [Me], and then to create an alert on this list that is set to send an email when someone changes an items that appears in the view.
This works well when there is only one person in the assigned person column. It does not work when there is more than one person in the assigned person column.
Does anybody know why this wouldn't work, or what I can do to troubleshoot? Is there a better way to achieve the end result? We could make several "assigned person" columns and not allow multiple selections, but that seems kind of kludgy.
Try this info site,
http://www.sharepointalert.info
it has a good alert trouble shooting guide.
The reason it works for one person but not multiple people is because the check is specifically against an individual. The comparison your view does is whether Assigned is equal to [Me], not if Assigned has [Me] as one of its entities.
Instead of using a list filter of is equal to, use the list filter contains. That should do the trick.
EDIT IN RESPONSE TO COMMENTS
To access the object model, you'll need to use Visual Studio. I'm unaware of a method to accomplish this kind of thing using SharePoint Designer, but maybe there's some sort of crazy Datasheet View thing you can do. Anyway... onto your actual needs...
The following code sample illustrates a very basic method for achieving your goal.
using (SPSite site = new SPSite("yourwebsiteurlhere"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["titleoflist"];
SPView view = list.Views["filteredviewname"];
view.Query = "<Where><Contains><FieldRef Name=\"assignfield\"/><Value Type=\"Integer\"><UserID Type=\"Integer\" /></Value></Contains></Where>";
view.Update();
}
}
Replace "yourwebsiteurlhere" with the website url, "titleoflist" with the title of your list in question, "filteredviewname" with the name of the view, and "assignfield" with the internal name that you used for your assignment field. If you created it through the standard SharePoint UI, this should be the name of the field without any spaces.
As far as where to run the code, you could put this kind of thing in a one-time workflow. I sometimes do that just to make sure I have necessary privileges. Hope this helps!
If you're not able to/allowed to use Visual Studio, then your solution will probably have to be to look into a 3rd party solution.