I have an activity (which calls a sub-process) with a destination rule of 'Plan per slot (no destinations), 'Select a list field to determine how many slots should be created'. This does a lookup to a sharepoint list. And all works well.
If I have 2 items in my list, all events in my activity are called twice (and 2 sub-processes are triggered.) One of these activities is to create a record in a SQL database and save the ID of this record for an update later in the activity. Again this works fine.
For escalations, I have created an 'Escalation After Rule' with a 'Default Action'. I have then written a c# Action Code which uses this ID and updates a value for it in the SQL database if it escalates. This update should be slot specific.
The ID is created as an Activity Data Field and when it is used at event level it works well. BUT in my escalation code it cannot find it. I reference it using the following: K2.ActivityInstance.DataFieldsa"ID"].Value.ToString();
I've read BLACKTOP's article on Data Field Scope (http://www.k2underground.com/blogs/blacktop/archive/2009/03/30/data-field-scope.aspx) and it says that '• Activity destination instance data/xml fields are in scope only during activity in which they reside but there is one copy of the field for each slot in the activity' which is exactly what I need. However, it won't let me code at activity destination level.
I've changed the data field to be 'shared' and the code can then find the ID activity data field but then updates the ID of just one of the slots (presumably because 'shared' means there's only one copy of the data per activity?).
It can't find the ID even if there's only 1 item in my SP list and only 1 slot.
Any help gratefully received. Thank you.