Jump to content

Recommended Posts

Posted

Hi Everyone, 

I'm having an issue with filtering purchasing transactions using the AJAX SDK readByQuery. I can filter on any combination of fields except for the STATE field. Example below, this always returns no results. 

api.ip_readByQuery('PODOCUMENT','DOCID,DOCNO,DOCPARID,STATE',"DOCPARID IN ('Department Approval') AND STATE='Pending'",1000,'json',callback);

However, if I filter on another field other than STATE it returns the expected results. See the example below. 

api.ip_readByQuery('PODOCUMENT','DOCID,DOCNO,DOCPARID,STATE',"DOCPARID IN ('Department Approval') AND DOCNO='PR0023'",1000,'json',callback);

Any idea what I'm doing wrong or is there a bug in the SDK? 

Any input would be highly appreciated. I logged a support case through the community and they were not able to offer much help. 

Sincerely, 

Jason

Posted

Hey @Jason Rogers

Filtering on the PODOCUMENT.STATE field works like a charm! From one Jason to another, thanks for the reply!

One newbie question, the solution works and feels non-intuitive. I'm querying the PODOCUMENT object already but referencing the STATE field through what feels like a relationship and the relationship doesn't exist. Why does this work? I can't seem to find any documentation regarding the single character key for the PODOCUMENT.STATE field. I'm drawing blanks. 

Any direction you can provide would be much appreciated.

Posted

Hi @Annie Schwartz

I'm having a hard time understanding the documentation for query fields. I  understand how to display and filter the field PODOCUMENT.STATE, the single character key for the state field (which is fantastic). I don't understand how I could come to that conclusion without someone telling me. 

From the documentation, it is not obvious to me that PODOCUMENT.STATE and STATE are different fields. 

I'm still not sure the reason why I cannot filter on the STATE field and have to filter on the PODOCUMENT.STATE field instead. 

 

×
×
  • Create New...