.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Item Approval

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :WPF


I need to apply a workflow to an existing .Net C# Web Forms application. Can anyone point me in the direction of a fully functional example?

I'm not sure whether I need sequential or state machine. In summary this is what I need the workflow to do:

- a new item gets added to a database table via a web form
- this then emails a coordinator
- the coordinator then assigns other users
- they get emailed
- they provide a response (if not then the workflow needs to send them reminder emails)
- the coordinator can complete / finish the workflow at any time


View Complete Post

More Related Resource Links

Item approval in Discusion borad


In a sharepoint discussion board, I am using content approval. As we know, Administrator can see all posts (approved as well as pending posts).

I want  to know, how can Admin differentiate among the approved posts and the posts pending for approval? can we change the color of the posts waiting for approval?



Correct use of FileRef with list item approval

Hi Devs, I'm trying to approve a document/list-item by means of the SP 2010 Web Service API. public static XmlNode UpdateListItemApprove() { listservice.Lists listProxy = new listservice.Lists(); string xml = "<Batch OnError='Continue'><Method ID='1' Cmd='Moderate'><Field Name='ID'/>"; xml += "<Field Name='FileRef'>http://sp2010/_catalogs/masterpage/minimal2010.master</Field>"; xml += "<Field Name=\"_ModerationStatus\" >0</Field></Method></Batch>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode batchNode = doc.SelectSingleNode("//Batch"); listProxy.Url = " http://sp2010/_vti_bin/lists.asmx"; listProxy.UseDefaultCredentials = true; XmlNode resultNode = listProxy.UpdateListItems("Master Page Gallery", batchNode); return resultNode; } However, I get an error: <Result ID="1,Moderate" xmlns="http://schemas.microsoft.com/sharepoint/soap/"><ErrorCode>0x81020030</ErrorCode><ErrorText>The URL '_catalogs/masterpage/minimal2010.master' is invalid.  It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.</ErrorText></Result>   Steve Curran often e

OOTB Approval Workflow SharePoint 2010 - Blank "Requested By" field appears in Task Item edit/view f



I am having a simple OOTB  approval worflow associated to the simple document library. Task is created when an document is uploaded to the library.  When I click the task item in task list, I see a blank field "Requested By"  right below the "Status" column and I am unable to understand from where this field is coming and how to populate this field. Any help would be great...

How to change a SharePoint list item Approval Status from Silverlight webpart



I'm facing the following problem:

I have an embedeed silverlight xap application inside a custom visual webpart, that access SharePoint data through Microsoft.SharePoint.Client.Silverlight classes, and I have to modify some fields from an item from a list that has "Require content approval" enabled. I update the item successfully, but its approval status is set to "Pending" afterwards. 

How can I re-approve the content programatically?

Some additional information:

  • SPList item has a moderation information field, but in Silverlight there is only "ListItem" which does not contain such field.
  • When I try to do "item["_moderationinformation"] = something", I receive a PropertyOrFieldNotInitializedException.
  • I can check for Item.ParentList.EnableModeration, but there is neither a field nor a method related to moderation on the item itself.
A possible solution would be to create and call a web service that approves the items, but I'd rather prefer to avoid hosting and calling a ws to cover this functionality.

Any help on this would be greatly appreciated.




Approval Workflow : Getting the name (or unique ID) of the item being approved in the infopath Task


I need to display the name/title of the item being approved in the infopath task form that is viewed by the approvers. How can I achieve this? The data fields in the Primary data connection seem to correspond to task item and not the item being approved itself.

Thanks in advance!

Workflow Approval Process not setting item's Approval Status



I've been pounding my head against the desk about this all afternoon.  I have a simple workflow attached to a document library that runs on item creation.  All it does is start the approval process on the current item and emails me and a few other people a task (in parallel).  I have another workflow attached to the document library that runs on modify and it looks to see what the Approval Status of the Current Item is.  If the Approval Status is Approved, the workflow copies the item to another library then deletes the current item.  Same with rejected (only sends it to another library).  Pending does nothing.  I modified the Completed step in the approval workflow to modify the item (to make sure the second workflow triggers)

All that works except, no matter what the Approval Status is alway Approved!  Even when first create the item and run the approval process, the item comes out as approved.  I even explicately set the Approval Status to Pending at the beginning of the first WF, but right after that, the item reverts back to being Approved.  How do I make the item be Pending until everyone has responded to the approval task?  I kinda thought that was the default procedure...


Copying approval from Workflow task to List Item.


I have a system for entering info into sharepoint.  When the info is first entered, the list info is sent to the manager for approval using the workflow approval process.  This work, the email goes through, and then is approved on the workflow, but we have the require content approval checked, and this approval stays on pending.  I am trying to do a look up on the task list, and then approve or reject based on that.  It is not working.  The If statement always is ok, and then it is approved, even if i set reject.  Can anyone help me with this?


For the workflow lookup, the Field Data to Retrieve is

DataSource is the Tasks list for the workflow

Field from source is Approval Status


The Find the list Item is

Field is Workflow Item ID

Value is Current Item:ID


I am using this info to try to pull the approval status of the workflow and then based on

that set the approval of the list item.



how to get the status of an approval workflow of item using sharepoint object model ?



There is a list on which an approval workflow is associated,workflow starts when an item is added.The list is having anonymous access so anyone can enter an item,but the item needs to be approved by an approver.Hence,each item will have a status(e.g. approved,rejected etc.).

Now,I am creating a visual webpart.I want to display the list items in a grid.But I need to display only those items which are approved.I am using sharepoint object model,How can I filter the items based on the approval status.


Editing an item whose draft item is waiting for approval causes runtime exception



I have a list where content approval is enabled by going to Version Settings page of the list. I have allowed to view the draft items only by the author of the item (who created the item) and the person who can approve. Now if an item's draft item is pending for approval, and if another user (who is neither the author nor the user from approver group) try to edit the item, he/she gets runtime error. The more details are reported on the site http://ranaictiu-technicalblog.blogspot.com/2010/11/sharepoint-2010-editing-item-whose.html


I'm not sure if the error is reported already. Can anybody help?


Sohel Rana

How to create list item on different site calendar after workflow approval

I have a vacation request located on our corprate home page that is available to all departments.  we have more department sites within the same site collection, each having their own calendar.  I am wondering if its possible to have the workflow create a list item on a different site calendar IF the department equals "other department".  So all departments submit the vacation request from the home site, then when it is approved the calendar in their department is updated.

Change the Setting After Approval Workflow done in Sharepoint List Item


Hi Team,

Me and My Team are new for Sharepoint and we want to resolved one task.
Scenario: We have approval workflow on Document List. Now, Our Client wants that once that Document is uploaded, workflow gets started for approval process. which we have done.
Now, They wants that once Document get approved, No one can change the document. It means document will be stop for editing, they can open that and review / print / do other action except Editing and Deleting.

Now, does anyone know how can we achieve the same using custom coding in Visual Studio or Sharepoint Designer ?
i guess we should remove the rights from that document permission for this else we have no idea.

But in either case, Please guide us How to do that step by step.
Thanks for your kind Support.

Thanks & Regards, Brijesh Shah

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







LINQ to SQL - Validating if item is in Database, but if item is not items not inserting into databas



I am new to this, so bear with me.  I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already.  If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database.  If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario.  I have tried moving the if and else statement to different parts of the code but can't quite figure this one out.  Any help would be apprecaited, attached is the code.  This code is set to a button press.  As a matter of fact, if you see any other errors along the way please feel free to point them out. 



    protected void enterBTN_Click(object sender, EventArgs e)
        //make new data context

        SHCDataContext insNewAll = new SHCDataContext();
        //LINQ to check if customer exists in database
        var checkExisting = from c in insNewAll.Customers
                            where c.custLastName.Contains(custLastNameTB.Text.ToString())
                            select c.custLastName;
        //make list to store values

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

Team System: Work Item Tracking


In this column, Brian Randell explains how to build a simple Work Item explorer and demonstrates the core operations needed to add work item support when building your own add-in.

Brian A. Randell

MSDN Magazine April 2007

Visual Studio 2005: Create Reusable Project And Item Templates For Your Development Team


Visual Studio 2005 introduces a new model that lets you define your own project templates and starter kits, something developers have been requesting for some time. Here Matt Milner shows you how to consume, create, and customize these templates.

Matt Milner

MSDN Magazine January 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend