Pregunta

Tengo un problema, con este evento. Lo que mi propósito es: Quiero actualizar una de las propiedades basadas en pocos criterios, por lo que quiero llenar un campo A si el campo A está vacío y el campo B no está vacío y el campo C tampoco está vacío.

Cómo hacerlo correctamente porque con SOTRETUPDATING Algunas actividades posteriores a veces son nulas o no existen en absoluto, etc., etc.

¿Algún buen consejo?

Solo para hacerle saber que se trata de SharePoint 2007

Actualización : El problema es que necesito comparar si el valor anterior y el nuevo valor: así que si alguien actualiza un artículo.

ex: Artículo actual: title= value1; title2= value1

Alguien actualiza en consecuencia: title= newvalue

El artículo actualizado debe tener un valor siguiente: Título= NewValue; title2= newvalue

La próxima vez siguiente Actualización: title2= deugeanewvalue;

El artículo actualizado debe ser como FOLLWOING: TITLE= DEMUDONEWVALUE; title2= deugeanewvalue;

, por lo que, básicamente, ambos campos deben mantenerse sincronizados NNO Materia cuál se actualiza, por lo que no puedo saber cuál de los campos se actualizó y luego que debo actualizar.

Usted ve

¿Fue útil?

Solución 3

Basically at the end I solved my issue myself.

Just by checking the listItem.AfterProperties["column"] and comparing them with ListItem["column"] and then setting the again to ListItem.AfterProperties["column"]= value;

Otros consejos

Just one question: Is there a reason for not using ItemUpdated where all your field would have been updated with the fresh information?

In ItemAdding you must check both BeforeProperties and AfterProperties to be successful in this task.

In ItemAdded:

title2 = title

In ItemUpdated workflow:

//Only when there is a change in title/title2 columns
if(title != title2)
{
    //Meaning title has changed
    if(title.beforeProperties.Value ==  title2)
    {
         title2 = title
    }
    //Meaning title2 has changed
    else if(title2.beforeProperties.Value ==  title)
    {
         title = title2
    }
}
Licenciado bajo: CC-BY-SA con atribución
scroll top