When all text fields are blank: <EQ> <fieldref name = 'textfieldname'/> <value type = 'text'> </value> </EQ>
When text field does not contain any characters: <isnull> <fieldref name = 'textfieldname'> </fieldref> </isnull>, the previous entry is invalid.
Text Field is case-insensitive, which depends mainly on the language settings of the database.
The format of user field is userid; # username, for example, 16; # Leo Ge
If a field is blank, this field may not be returned. The xmlnode attribute must be validated first, for example:
If (I. Attributes. getnameditem ("ows_machine ")! = NULL) taskitem. Machine = I. attributes ["ows_machine"]. value;
General getlistitems practices: Xmldocument xmldoc = New Xmldocument ();
Xmlelement Query = Xmldoc. createelement ( " Query " );
Xmlelement viewfields = Xmldoc. createelement ( " Viewfields " );
Xmlelement queryoptions = Xmldoc. createelement ( " Queryoptions " );
Query. innerxml = " <Where> "
+ " <Or> "
+ " <EQ> <fieldref name = 'macher'/> <value type = 'text'> " + Machinename + " </Value> </EQ> "
+ " <Or> "
+ " <Isnull> <fieldref name = 'macher'> </fieldref> </isnull> "
+ " <EQ> <fieldref name = 'macher'/> <value type = 'text'> </value> </EQ> "
+ " </Or> "
+ " </Or> "
+ " </Where> " ;
Viewfields. innerxml = "" ;
Queryoptions. innerxml = "" ;
Xmlnode Node = WSS. getlistitems ( " {E7E1EEC8-F627-48A9-8228-F4BC1CA45F0C} " , " {FC3C7DFF-7399-4944-A155-56AF8BCB0F11} " , Query, viewfields, " 100 " , Queryoptions, Null );
Nametable NT = New Nametable ();
Xmlnamespacemanager xnm = New Xmlnamespacemanager (NT );
Xnm. addnamespace ( " RS " , " URN: Schemas-Microsoft-com: rowset " );
Xnm. addnamespace ( " Z " , " # Rowsetschema " );
Xmldoc = New Xmldocument ();
Xmldoc. importnode (node, True );
Foreach (Xmlnode I In Node. selectnodes ( " RS: Data/Z: Row " , Xnm ))
{
Int ID = Int . Parse (I. attributes [ " Ows_id " ]. Value );
String Title = I. attributes [ " Ows_title " ]. Value;
Bool Reloaddata = I. attributes [ " Ows_reload_x0020_data " ]. Value = " 1 " ? True : False ;
Datetime created = Datetime. parse (I. attributes [ " Ows_created " ]. Value );
String Createdby = I. attributes [ " Ows_author " ]. Value; // Format: userid; # Username
Datetime modified = Datetime. parse (I. attributes [ " Ows_modified " ]. Value );
String Modifiedby = I. attributes [ " Ows_editor " ]. Value; // Format: userid; # Username
Enumstatus status = (Enumstatus) enum. parse ( Typeof (Enumstatus), I. attributes [ " Ows_status " ]. Value );
If (I. Attributes. getnameditem ( " Ows_machine " ) ! = Null ) {//Fields that may be null must be checked first.
StringMachine=I. attributes ["Ows_machine"]. Value;
}
}