SharePoint Workflow Design, Receptores de eventos e “Actualizar elemento de lista” contra “Establecer campo baixo actual”

Temos un conxunto de fluxos de traballo do SharePoint Design que "comunicar" with an event receiver on the list via changes to site column values. Por exemplo, unha columna de sitio "SetDuedate" é definido como verdadeiro polo fluxo de traballo, o receptor de eventos detecta ese cambio, calcula unha data de caducidade e atribúe esa data a outra columna de sitio, "Due Date." We split things up like this because the event receiver can calculate a due date using complex business rules (taking weekends and company holidays into account) while SPD really can not.

In one specific instance, we ran into a problem with this trick. Debugging all this is pretty difficult, but we came to the definite conclusion that in one case (polo menos), the event receiver was not running all the time. In one step of the workflow, we would change the value of a site column and the event receiver didn’t appear to run. Con todo, it was running consistently in a different step of the workflow.

After reviewing it, I noticed that the happy workflow step used the "Update List Item" while the other step used "Set Field in Current Item." Update List Item was updating the "current item." I’m not sure why we picked one over the other since they would seem to be doing the same thing.

Así … the Update List Item action did cause the event to fire. Por outra banda, the Set Field in Current Item action did not.

I used Update List Item in both places and viola! It worked. [[ Total aside, I played the violin for on a daily basis for almost 15 anos ]]

From this, I tentatively believe that the "Set Field" action does not cause event receivers to fire, at least some of the time.

This issue bedeviled us for weeks.

This is one of those "observed behavior" posts. I observed this happen once in a specific environment and I’m making some guesses as to why things happened as they did. If you have any insight into this one, please share in the comments.

</final>

Rexístrate para o meu blog.

3 pensamentos sobre "SharePoint Workflow Design, Receptores de eventos e “Actualizar elemento de lista” contra “Establecer campo baixo actual”

  1. Ningún nome
    Ola Paulo,
    Nice blog you got there.. One quick question for you..
    Update List Item is supposed to be for updating any list item on the same sharepoint site..right?
    Para min, it only works for the same list (just like Set Field in Current Item).. So what do I use for updating values from a different list?
    Grazas.
    Honeyhline~
    Responder

Deixe unha resposta Deepak cancelar resposta

Enderezo de correo electrónico non será publicado. Os campos obrigatorios están marcados *