Author Topic: ItemQuery using NameFilter Possible?  (Read 2922 times)

bpmark

  • Member
  • *
  • Posts: 9
ItemQuery using NameFilter Possible?
« on: October 03, 2009, 03:28:46 PM »
Greetings to all, I've been trying to use the ItemQuery with NameFilter as follows, Product SKU being a text field within the current record:  (Partial script below, Begin/End sessions in place).

SetVariable [ PCQB_RqNew ( "ItemQuery" ; "" ) ]
SetVariable [ PCQB_RqAddFieldWithValue ( "NameFilter" ; "Contains" ; Product SKU ) ]

On the second SetVariable, an error is returned as follows:

CODE: -1000
SEVERITY: Failure
MESSAGE: Unable to parse attribute list. Ensure that attributes are properly formatted. Attributes (has 2 boxes here)b

The entire script does complete, but returns the entire Item List instead of the single expected record. Is this the correct function? Syntax issue? Seems to match the Intuit OSR). Does the NameFilter work with FMBooks?

Any help is GREATLYappreciated.

Mark D Kerr






bpmark

  • Member
  • *
  • Posts: 9
Re: ItemQuery using NameFilter Possible?
« Reply #1 on: October 04, 2009, 10:18:54 AM »
I know it's probably a little ususual to post your own response, but...

The NameFilter needs to be passed as 2 function calls as follows...

SetVariable [ PCQB_RqNew ( "ItemQuery" ; "" ) ]
SetVariable [ PCQB_RqAddFieldWithValue ( "NameFilter::MatchCriterion" ; "Contains" ) ]
SetVariable [ PCQB_RqAddFieldWithValue ( "NameFilter::Name" ; Product_SKU ) ]

I feel safe in mentioning that the documentation REALLY needs some expansion into syntax and examples.

Enough said about that, the product works nice once you make the breakthrough.

Mark D Kerr
FM9 Certified Developer



Melinda DePalma

  • Member
  • *
  • Posts: 179
    • Productive Computing
Re: ItemQuery using NameFilter Possible?
« Reply #2 on: October 06, 2009, 01:21:02 PM »
Thank you for posting a response to your question as I am sure that will be very useful for future readers. We will be expanding the documentation to include additional syntax and examples and thank you for the recommendation as we do highly value customer feedback.  :)