Post

1 follower Follow
0
Avatar

Query returning null data

I have a query that returns these fields:

"State.Name", "SYSID", "Name","Description","Project.C_Division.Name", "Project.C_Department.Name", "Work",

"Project.PercentCompleted", "Project.C_CapEx","Project.C_Opex_OneTime","Project.C_OpexAnnualizedBenefit"

 

It returns the correct values for all the fields except "Project.C_CapEx","Project.C_Opex_OneTime","Project.C_OpexAnnualizedBenefit" which are all money fields.  It always returns null.  Any idea why that is?

 

My code is pretty straightforward:

 

EntityQuery query = new EntityQuery();

query.TypeName = "WorkItem";

query.Fields = GetSelectedFields();

QueryResult queryResult = clarizen.Query(query);

 

Emad Ibrahim Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hi Emad, sorry I didn't catch this earlier. I usually get an email for each post (didn't get one for this).

If it ever happens we don't respond within 3 days, try reposting or contact your CSM to check up.

We have no known issue with money fields over the API. I can think of 2 reasons why your results have null values where you expected differently.

  1. I can see the fields you get null_s for are custom fields. What Clarizen entity are these fields defined for? If they are defined for _Task, or Milestone they don't exist on Project. _This doesn't produce an error, but a null _FieldValue object.
  2. If those fields are defined for _WorkItem _or _Project _you may get a _null _on the _FieldValue.Value_property (the _FieldValue.FieldName _will have a value) if no value was entered for those fields on the relevant project.
    Regular custom fields always default to null value. Even if a default value was specified on the field definition it applies to new objects only.

Hope this helps.

Ophir

Ophir Kenig 0 votes
Comment actions Permalink