sharepoint workflow - sharepoint

I am new this sharepoint development and i have task in hand to do the following.
1.When a new document added to the library, the system will prompt for approvers & audience from a database table. this will be stored for future revisions for the document.
2. Upon successful completion of assigning approvers, audience the system will initiate the workflow to complete the approval process.
It would be great if anyone can point the direction to do the following:
1.is it possible to call a aspx page/form from document library insert/update event?
2.How to assign approvers to a workflow programmatically?
Thanks in Advance!
Alex

I'm not sure it is possible to explicitly call another page but you can use the "Source" url parameter to specify the page they are directed to after they press OK. Obviously, you will have to change "www.google.com" to be your new URL.
/Lists/Announcements/NewForm.aspx?Source=www.google.com
You can probably do all of this using custom workflow. With custom workflow you have two options: creating the entire workflow in visual studio or create custom workflow actions and using SharePoint Designer to build the workflow.
Building custom Workflow Actions.

Related

How can I add a button to approve tasks to a sharepoint list?

I want to make the approval process easier. For this I have thought of adding a button to a column of a sharepoint list.
The user would see the list of tasks pending approval and clicking on the task button would automatically be approved.
How can i do this (workflow,javascript...)? Is that possible?
Thanks for your answers.
Using the sharepoint workflow system, the user can approve from the task detail form already.
If you want to make it more user friendly as you suggested, you may program an extra field, using JSLink technology to customize the task list rendering or to add this approval button from an other list (I assume you are using sharepoint 2013 on premise) from which you call javascript API to trigger the approval.
Read more :
JSOM Api to approve a task
JSLINK
Yes, a workflow would work. I would have a separate "Approved" column that defaults to "No" (don't show it on the form). And run a workflow (upon form submit?) that changes the value of Approved to "Yes".

Is it possible to add workflow modification programmatically?

I`m interested in adding SharePoint Workflow Modification programmatically from my workflow, without using forms.
What i'm trying to achieve - I want to add Workflow modification when user uploads new document version to document library. I have OnWorkflowItemChanged and from there i'm willing to add WF Modification.
Is this possible?
To clarify some things:
I`m writing a custom Workflow in Visual Studio.
What I want is to add items to (SPWorkflowModificationCollection) SPWorkflow.Modifications object. However there is no Add method, but the designed way to add items there is by using Workflow Modification forms.
In this case, i don't want user to use modification form, but i want to add workflow modifications (which will populate the collection AND triger OnWorkflowModified event).
I am not 100% sure what you mean by workflow modification. Do you want to modify the workflow itself from a workflow or just modify a document or item from a SharePoint Workflow?
Regardless, I'll give you the same answer to what was accepted as the answer to a similar question.
Workflow is one of the strong parts of SharePoint. Out-of-the box you or your users can build workflows using the free SharePoint Designer. Depending on your exact requirements this may be good enough.
If you need a more advanced workflow editor then you may want to consider Nintex Workflow or K2. Alternatively you can write your own workflows in Visual Studio or buy 3rd part Workflow Actions for SharePoint Designer.
I have included some useful links below:
Building workflows using SharePoint Designer
Creating workflows using Visual Studio
3rd Part Workflow actions to embed VB or C# directly into SharePoint Designer Workflows. Note that I have worked on this product so consider my recommendation biased ;-)

Workflow with user selecting Destination doc library

I am trying to implement a Workflow, where the user needs to select a destination document library.
I could figure out two possible ways:
Once the user manually starts the workflow, we would display a webpage where he would select the destination document library.
we would initially display a webpage. where User would select the destination.
After clicking a button the workflow would kick start.
Now for possibility "1":
How to redirect from a worlflow to a webpage. [tried Server.Transfer, but failed].
for Possibility "2":
How to start a workflow on button click.
Please also suggest which among the above 2 possibilities is a better solution.
What you need is a workflow initiation form. Exactly how you implement it and how much functionality can get will depend on the type of workflow you are working on, but you should be able to set up something to choose the destination.
I am assuming that you are talking about writing a workflow using Visual Studio. Personally, I would try creating a SharePoint designer workflow first to see if that meets your requirements.
In SharePoint Designer you can create an initiation form that accepts data from a user when they manually start the workflow. If the out of the box actions don't quite do what you need them to, you can create your own reusable custom workflow actions.

SharePoint Approval

I need to add sharepoint approval to a list... and I was hoping to use the default approval process... but... I need to run some code once an item is approved. Do I have to then use VS to create a custom workflow?
I need to run some code that currently runs in an event reciever. I need to move the code to another function (as we are moving the processing out of event reciever code and now based on item approval). This code would execute after the item is approved and can be hosted as a service or .net code.
Full commented source to a state-machine based approval workflow comes with the MOSS SDK 1.5 in the samples directory.
http://www.microsoft.com/downloads/details.aspx?familyid=6D94E307-67D9-41AC-B2D6-0074D6286FA9
-Oisin

Submit issues - send to 2 locations at once

How can I Submit an InfoPath form to a SharePoint library AND to an email box at the same time when the user hits SUBMIT?
I need my form to be approved by several users in a particular order; then re-submitted to the SharePoint site, and to another email box so that the next approver can see the approvals, and approve their own, then submit it and have it drop onto Sharepoint again, etc.
The email chain works (the form as an attachment), and the approvals show, but the form doesn't get updated on the SharePoint Form library.
You can add an additional DataSource for submission (send to SharePoint library) and add a rule to your submit button before the save&close rules.
BUT - I would suggest a method that is based on workflows and a form that is held on a SharePoint site. I had a very similar task, where approvals were needed in a staged manner.
If there is a fixed number of approvers, create fields for each one - if the number is not fixed you will need some replacing rules that change the current approver with the next one. Then you will need one (or more) workflows that are triggered by a flag field (or more) that you promoted before. (Make them writable from the outside during publication - the workflow will need that) This field (or fields) trigger the workflow that sends the email. After sending it should clear that flag to avoid infinite looping.
The mail should contain a link to the SharePoint library. And the approver should work on that library rather than sending the XML file through the network.
Hint: Enable versioning on that libary - and you (or the approvers) can keep track of the changes.
Hint 2: If this process will be part of the daily work, maybe a custom view and alerts will help the approvers keep track of the form's status.
Sorry for asking but have you considered using a workflow rather then emails? I'm not sure whether the basic workflows in WSS 3.0 will cater for your senario but the MOSS workflow should be more than adequate.

Resources