cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Query to update the object

Maharajan_Mahar
Champ on-the-rise
Champ on-the-rise

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)

1 ACCEPTED ANSWER

Brian_Kalbfus
Confirmed Champ
Confirmed Champ

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.

View answer in original post

2 REPLIES 2

Brian_Kalbfus
Confirmed Champ
Confirmed Champ

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.

@Brian Kalbfus Thank you. It worked.