In a Task View, if I set a view filter to only show tasks or subtasks, how can we achieve the goal?
For example: the view that will be returned:
Task1 (001)
Task1 Subtask (001001)
Task2 (002)
Task2 Subtask (002001)
Scenes 1 : I would like to show only Task1 and Task 2 exclude the Task1 Subtask and Task2 Subtask.
I've tried editing the ViewQuery :
<View><Query><Where><IsNull><FieldRef Name="ParentID" /></IsNull></View></Query></Where>
Scenes 2 : I would like to show only Task1 Subtask and Task2 Subtaskexclude the Task1 and Task 2 .
I've tried editing the ViewQuery :
<View><Query><Where><IsNotNull><FieldRef Name="ParentID" /></IsNotNull></View></Query></Where>
Here is the client code: Show the detail of all the subtask
function getCertType(){
var clientContextCertType = new SP.ClientContext.get_current();
var oListCertType = clientContextCertType.get_web().get_lists().getByTitle('Task Management');
var queryCertType = new SP.CamlQuery();
queryCertType.set_viewXml(
'<View><Query><Where>' +
'<IsNotNull><FieldRef Name="ParentID" /></IsNotNull>' +
'</View></Query></Where>'
);
this.oListItemCertType = oListCertType.getItems(queryCertType);
clientContextCertType.load(oListItemCertType);
clientContextCertType.executeQueryAsync(Function.createDelegate(this, this.onSucceededGetCert), Function.createDelegate(this, this.onFailedGetCert));
}
function onSucceededGetCert(sender, args) {
var listItemEnumeratorCertType = oListItemCertType.getEnumerator();
str = "";
while(listItemEnumeratorCertType.moveNext()){
var itemCertType = listItemEnumeratorCertType.get_current();
var arryMail = itemCertType.get_item('Title');
str +="ID : " + itemCertType.get_id() + "\n" + "Title : " + arryMail + "\n" + "ParentID : " + itemCertType.get_item('ParentID').get_lookupValue() + "\n" + "*****" + "\n";
}
alert(str);
}
function onFailedGetCert(sender, args) {
alert("error : ");
}