Hi,
I am new to this site as well as to the SharePoint and was wondering if you could help me out.
I have a column in a SharePoint list called ‘STATUS’ and it has 3 choices: ‘Submitted’, ‘Rejected’ and ‘Approved’. I want to know when the status of a particular line was changed to ‘Approved’.
The motive is to find out how many projects were approved in the last 6 months. We do not have an additional column which states ‘date of approval’ otherwise I could have used this to query the approval date.
Can anybody please help me to find a formula / script to base a new column on (e.g. ‘PO Approved’) , so that I can query this information ?
I have seen in the version history for the list item that the information is present so can I use this?
Thanks in advance.
Some additional thoughts here…
1) You can do an event receiver which tends to be complex (as Mark noted above)… As of SharePoint 2013 and above, you probably want to use Remote Event Receivers (RER abreviated) which I have found to be painful and hard to write. The old SharePoint 2010 Event Receivers worked well, but debugging was challenging. RERs I have found to be painful to write and debug. C# coding…
2) You can use the SharePoint Change Log and monitor the changes that occurs in a list or library. I have found this to be very efficient for writing lots of straight forward code without a lot of complexity in the project and infrastructure… https://msdn.microsoft.com/en-us/library/office/bb447511(v=office.14).aspx
I ended up creating a C# console application that monitors the change log and then executes code based on that. We use Task Scheduler to execute and run it… Very straight forward and simple.
3) Use a SharePoint workflow, created in SharePoint Designer. When the list item is either created or modified, you change check if the value is approved and then set the value of another field in that case.
Route 3 is probably the approach you want to use if you are (a) not a developer or (b) you are a developer who is going to do very little code in SharePoint.
Hey Harpreet, welcome on board and thanks for the question.
To answer your question, I think you will need to write some C# code to develop an Event Receiver for your List. The Event Receiver would then fire when the item was updated which would then update your new column with today’s date, but only if the item was ‘Approved’.
There may be another way to achieve this, but this is the one that comes to mind as I am a developer by trade 🙂