Friday 4 July 2008

Creating view which shows approved/rejected items at workflow

[TR]
Sharepoint'te bir listeye workflow bağlayıp herbir item için onay almanız mümkün. Bunu yaptıktan sonra bir view tanımlayıp sadece kabul edilen önerileri görmek isterseniz muhtemelen ilk yapacağınız şey bir view tanımlayıp Workflow Status kolonu is equal to Approved yapmak olacaktır. Ancak view'a dönüp baktığınızda hiçbir item'ın gelmediğini göreceksiniz. Hatta is equal yerine is not equal yazarsanız bu defa da query error ile karşılaşacaksınız. Bunun nedeni Sharepoint'in Accept, reject gibi değerleri enum olarak tutmasıdır. Buna göre kabul edilen öneriler için Status is equal to 16 demeniz gerekiyor. Diğer durumları ve kodlarını aşağıda bulabilirsiniz.

Durum Değer
Not Started 0
Failed on Start 1
In Progress 2
Error Occurred 3
Canceled 4
Completed 5
Failed on Start (retrying) 6
Error Occurred (retrying) 7
Canceled 15
Approved 16
Rejected 17

[ENG]
Sharepoint allows you can to connect an approval workflow to a list. If you want to see the items that has been approved the first thing you will probably do will be creating a new view and settind Workflow Status column is equal to Approved. But when you look at the list you will see that there is not any item at that view. If you modify this view and change is equal condition as is not equal you will get a query error at view's display page. Reason for that is sharepoint keeps that conditions as enum. for example if you want to display only approved itemsi you must set Workflow status is equal to 16. Here are other workflow status and codes

Status Code
Not Started 0
Failed on Start 1
In Progress 2
Error Occurred 3
Canceled 4
Completed 5
Failed on Start (retrying) 6
Error Occurred (retrying) 7
Canceled 15
Approved 16
Rejected 17

No comments: