SharePoint document approval workflow, modified and approved by fields - sharepoint

I working on a SharePoint document approval process and here is the scenario: A document is uploaded in the document library, and approval process is initiated. A task is created and assigned to a group (Active directory group) where only one group member can complete the task. What is required is the modified by and approved by fields to display the name of the user who completed the task and not the group name that the task is assigned to.
1) I have tried the out of the box workflow, and if displays system account as the user who completed the task.
2) I have tried SPD approval workflow, and it displays the group name assigned to.
3) I have tried VS sequential workflow :
With VS workflow, I’m able to set the correct user to the two fields (modified by and approved by) and as the last step I need to set the approval content status as follows:
item.ModerationInformation.Status = SPModerationStatusType.Approved; (if approved)
But this runs with system account permission and not the current user, so it resets the field approved by back to system account, and if I swap the sequence of my steps and set the content status first then update the fields last, obviously I’m doing a modification on the item so the content status changes back to draft.
Is there a way I can run this item.ModerationInformation.Status = SPModerationStatusType.Approved; under the current user? Or any way I can achieve my goal?

I would suggest leaving the system columns alone and creating a completely different set of columns for your purposes.
So Create the columns: "Item Modified By", "Item Approved By"
Then write the current user to these fields.
Lastly, remove the system generated "Modified By" and "Approved By" from the default view and replace them with your "Item Modified By" and "Item Approved By" columns.

Related

NetSuite: SuiteApp to Group Tasks?

is there a SuiteApp which would allow to group tasks?
Example: Employee Onboarding
And you could have multiple tasks under the template assigned to different people etc.
Thanks
I can't see any suiteapp that would do this.
If you are familiar with custom records & workflow, you can try to do this, I am using project name for the custom records for illustration :-
Create a custom record name "Project Header", with field say Project Name. You can create more fields like project status or project type if required.
Create a Subtab "Project Tasks" and Assign to the Child Records after the below custom record is created.
Create another custom record "Project Tasks" which will be child of the "Project Header" with below fields :-
Project Id > Type:List/Record, List/Record: Task Header, Record Is Parent: Checked
Task Name > Type:free-form text
Assigned To > Type:List/Record, List/Record: Employee
Turn On "Allow Child Record Editing" and "Allow Delete" in this custom record.
Then try to enter a new project with more than 1 tasks and save. Assuming this is your project template. You can edit and make copy to "duplicate" the project.
You can further enhanced this by using workflow to send email alerts upon new tasks created to the assignee.
Hope this give you some ideas if you thinking to customise this yourselves which will give you more flexibility then suiteapp.

Sending out alerts when a certain option is chosen on a Sharepoint form

I have a SharePoint list, with two different views when creating a item in that list. Let us call these views, "regular user view" and "Approver user view" and the two views differ because one of the fields is hidden in the "regular user view" and is shown in the other view. Let us call this hidden form field "Approved or Decline". The particular group that the field is shown for, will come in after the regular user creates a new item and either changes the value of the "Approved or Decline" form field to either Approved or Declined based on if that person wants to accept or decline the request. How do I set up a alert, so if the "approver" declines a request, a notification is sent to the person that initially made that request?
That sounds like a SharePoint Workflow configured with SharePoint designer. Here is an overview of workflows: https://dev.office.com/sharepoint/docs/general-development/sharepoint-workflow-fundamentals
You would need to have the workflows automatically run when an item is created or modified and inside you would detect when the "Aprroved or Decline" field == "Declined" and in that case send an email to the original creator of the item.

Add fields to Sharepoint Workflow Task

I'm currently making a pretty simple approval workflow in sharepoint using sharepoint designer. One of the design goals that we have for this workflow is that we want to minimize the amount of custom coding that we have to do so I'd appreciate answers that involve using sharepoint designer instead of whipping out VS.
So the workflow should start when a person adds an item to a list.
When the workflow kicks off it would create a task and and assign a due date of +2 business days and assign the responsibility to a group of users
When a user completes the task then it would record the individual person who completed the task as well as the date it was completed.
It's pretty easy to add fields to the list but the purist in me kind of balks at this since these fields would be null and it violates first normal form. Ie a list that went to Task1 but not Task2 would have four fields Task1ApprovedBy, Task1FinishedDate, Task2ApprovedBy, Task2FinishedDate and both the Task2 fields would be null.
--edit--
Sorry If I'm not being clear about the question. I'm using Sharepoint Designer and I would like to update a list item in a lookup when a user completes a task item. How do I select the last task for a particular item that was completed and update that last task two values "Completed By" and Completed Date values? I'd prefer to do this on the Task list since that would also make reporting easier. I'd just create a view on the Task list instead of doing some type of join between the two list to when a particular task was completed.
Thank you for the help!
Jason
It sounds like you need two workflows here. One on the "Main" list and one on the "Tasks" list:
The first workflow is tied to the "Main" list. It fires when a user creates a new list item in the "Main" list. This workflow simply creates a new item in the "Tasks" list (with the correct people assigned, description, dates, etc...)
The second workflow is tied to the "Tasks" list. It fires whenever an item in the Tasks list is changed. The workflow checks to see if the status field is "Complete". If it is, then assign the "Completed By" field to the current person editing the task and assign the "Completed Date" value to today.
(Note that, in a SharePoint Designer workflow, there is no way to evaluate the properties of the list item prior to the update. If a completed task is updated, the SPD workflow will be unable to determine that the task was already completed. Basically, each update to a completed task will update the Completed By/Date fields. If you want a more complex workflow - which only updates when the status is changed to "Complete" - you will need to use Visual Studio).

SharePoint Issue Tracker - auto approve if in a group and auto set of 'source'?

SharePoint 2007
I've setup and Issue Tracker as a quick ticket system. I gave everyone in all the internal domains access to view the page and to create items, then I made a list of team members and gave them rights to edit/delete items (etc).
The Issues all have a "pending/approved" column and a radio button selection on the new issue form to choose between "internal" or "external" issue (if a core team member created the issue or someone from the outside).
I'm not sure if it's possible but I've been trying to figure out how auto set the internal/external radio selection (if the person creating the issue is on the list of core team members - auto set 'source' to 'internal' else 'external'. And I've also been trying to figure out how to auto-approve items if they are internal items.
So, if someone on the team member group list creates an issue it should be automatically have it's source set to "internal" and it should be auto-appoved.
Thanks for any help!
One solution would be to use SharePoint Designer like this:
Customize the NewForm.aspx to remove the internal/external field altogether from the initial creation.
Create a new workflow on the list that automatically starts when a new item is created.
Use the condition "Created by a specific person" and choose the created by to be the Team Members group
Set the action to "Update List Item" and set the Internal/External field to internal
Add an additional action of "Set Content Approval Status" and set it to Approved
Click the "Add 'Else If' Conditional Branch" link
Add an action for the Else condition of "Update List Item" and set the Internal/External field to external
The first step is just for appearance (since regardless of what they choose you will be setting it for them automatically). The workflow will take care of auto setting your fields based on the creator's group membership.
You need an event receiver that fires on ItemAdded (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx) that sets both Source depending on the user that posted the issue and approves if source is internal.

how to get the input given by a user through collect in a worflow through designer 2010?

i am using collect keyword to get an input from the user.
now inside the collect;
i have a custom form field with the name update status.
update status - choice field - user will be able togive approved/ rejected.
now in the sahrepoint designer workflow;
collect "Name" from "Jiben" (Output to variable:collect).
i want to update a field "STATUS" in the list associated with the workflow using the input from the user ?
is there any way to do that.
i am sturggling for doing this from today morning :( please help.
Like explained here you will need to get your "Name" field via looking it up in the related tasks.
Let's say you have a collect data from user activity. "New Task". It has one custom field "MyField" (Text). It gets this data from user X and Output is set to Variable "collect". This variable will be the TaskID you want to look up.
So to set the field "Status" on your current list item, you can use a "Set Field in CUrrent Item" Activity. You only need to click the "Fx" and select the Task list where you have your collect data activity store your tasks (Association: Task List), Field from Source will be "MyField" and the Find the List Item you only need to set the Field to "ID" and the Value to "collect".
You should read some tutorials on how to design a workflow with Sharepoint Designer as there are many easy explanations and even nice sample videos explaining exactly your problem.

Resources