ItemUpdating 수정에서
-
10-12-2019 - |
문제
이 이벤트와 함께 문제가 있습니다. 내 목적은 무엇입니까? 몇 가지 기준을 기반으로 속성 중 하나를 업데이트하고 싶습니다. 필드 A가 비어 있고 필드 B가 비어 있지 않고 필드 C는 비어 있지 않아야합니다.
AttemUpdating on Attremproperties가 때로는 null이거나 전혀 존재하지 않기 때문에 올바르게 수행하는 방법이 있습니다.
좋은 조언은 무엇입니까?
SharePoint 2007 에 대해 알게하십시오.
update : 문제는 이전 값과 새 값을 비교해야한다는 것입니다. 그래서 누군가가 항목을 업데이트하는 경우
ex : 현재 항목 : title= value1; title2= value1
누군가가 업데이트됩니다. 제목= NewValue
업데이트 된 항목은 다음 값이 있어야합니다. title= newValue; Title2= NewValue
다음 번 다음 번에 업데이트 : Title2= SuctoNewValue;
업데이트 된 항목은 Follwoing : Title= SuachAnewValue; Title2= acueAnewValue;
그래서 기본적으로 두 필드는 모두 업데이트 된 NNO를 동기화해야하므로 필드 중 어느 것이 업데이트되었는지 알 수 없으므로 어느 것이 업데이트해야 할지를 알 수 없습니다 ..
가 표시됩니다
해결책 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;
다른 팁
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 } }