06-09-2022 07:01 AM
I'm getting the following exception when I try to add the constraint. And, I'm pretty much following this link https://sdk.onbase.com/unitySDK/html/4f99b05d-562e-4972-8a0e-d54c38e13bb0.htm and below is my code.
public void Update() { Hyland.Unity.WorkView.WorkView wvModule = _application.WorkView; var studentApplication = wvModule.Applications?.Find("Application Name"); Filter allStudentsFilter = studentApplication.Filters.Find("Student Search"); FilterQuery studentFilterQuery = allStudentsFilter.CreateFilterQuery(); studentFilterQuery.AddConstraint("OnBase Student ID", Operator.Equal, 2); // breaking here FilterQueryResultItemList studentList = studentFilterQuery.Execute(10); // code follows to update.. }
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Hyland.Unity
StackTrace:
at Hyland.Unity.WorkView.FilterConstraint.SetValue(Object value)
at Hyland.Unity.WorkView.ModifiableFilterQuery.AddConstraint(String dottedAddress, Operator op, String value)
at Hyland.Unity.WorkView.ModifiableFilterQuery.AddConstraint(String dottedAddress, Operator op, Int64 value)
06-09-2022 08:43 AM
I would try:
```
studentFilterQuery.AddConstraint("OnBaseStudentID", Operator.Equal, 2); // breaking here?
```
I don't believe attributes can have spaces in them. When you create them, Onbase quietly ignores spaces you enter in the attribute name when you enter them for the Display Name.
06-09-2022 08:43 AM
I would try:
```
studentFilterQuery.AddConstraint("OnBaseStudentID", Operator.Equal, 2); // breaking here?
```
I don't believe attributes can have spaces in them. When you create them, Onbase quietly ignores spaces you enter in the attribute name when you enter them for the Display Name.
06-09-2022 10:12 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.