开发者

SharePoint - Auto-increment dates in new records?

I have a list that's going to be updated with relatively static data weekly, and I wanted to create a workflow to do this automatically. The only field I'm having trouble with is Start Date.

I want the new Start Date to be exactly one week after the previous week's (row's) Start Date, but I can't figure out how to capt开发者_Go百科ure this. I can't seem to find an easy way to get the value of the previous row.

Now, theoretically, I could just have the workflow run once a week on a given day and use [Today] as the value for the field; however, a requirement is that the list can be populated a few weeks in advance if needed.

Thanks in advance for any help you can provide!


You could solve this problem by creating a custom Field type that queries its parent list for the most recent item and set itself to be the desired date. MSDN has a number of decent references for how to create custom field types.

I recently did something akin to this: I created a "Unique Number" field type that will ensure that no two rows contain the same numerical value in the same column.


Why not just query the list and order by date descending. The first row returned is the previous week's date?

The CAML Query would look something like this:

<Query>
   <OrderBy>
      <FieldRef Name='Modified' Ascending='False' />
   </OrderBy>
</Query>

I use U2U CAML Query Builder for syntax help...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜