> Any ideas why the request would still be returning all records?
Because all records have been modified? I believe a Customer TimeModified field is updated when any transaction is added or modified. Adding or modifying a Payment, Credit Memo, or Invoice will update the Customer's Balance Due, and that in turn will update the TimeModified field.
As for getting the value of the retCount attribute, you'll have to resort to XPath because the two functions that would let you get it directly are listed as "Still under development" in the FM_Books_Connector Functions Guide. The PCQB_ZParseXML( XML ; IsPath ; Xpath ; optFilePath ) function can give you what you want. I can't double-check at the moment, but it looks something like this...
PCQB_ZParseXML( PCQB_SGetXML( "Response" ; "" ) ; "" ; "/CustomerQueryRs/@retCount" )
...and will return...
...if there are 999 Customer records in the Response.
NOTE: you can get a count with much less effort by applying PatternCount like this:
PatternCount ( PCQB_SGetXML( "Response" ; "" ) ; "<CustomerRet>" )
Neither of these will help you understand why you're getting all records in the Response. I'm wondering whether the $time element is really in the format you posted. You'd get all records if that element is empty or invalid.
Are you using FileMaker Advanced? If so, open the script debugger and step through the script, stopping after you evaluate the PCQB_RqCloseRelatedRecord function but before you evaluate the PCQB_RqExecute function. Open your Data Viewer and evaluate this expression PCQB_SGetXML( "Request" ; "" ) and copy/paste the result back here.
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC 28105