Author Topic: Modified Date Range Filter  (Read 2159 times)

mikekurm@wienerminder.com

  • Member
  • *
  • Posts: 13
Modified Date Range Filter
« on: July 18, 2012, 03:05:10 PM »
Can anyone tell me what format the dates need to be. I've tried "2012-12-31T00:00:00". I just need a list of invoices over a certain date range. Also, I have use both "ModifiedDateRangeFilter::ToModifiedDate" and "ToModifiedDate" (and FromModifiedDate).

PCQB_RqNew ( "InvoiceQuery" )
PCQB_RqAddFieldWithValue ( "EntityFilter::FullName" ; $CompName )
PCQB_RqAddFieldWithValue ( "ModifiedDateRangeFilter::FromModifiedDate" ; $DateFrom )
PCQB_RqAddFieldWithValue ( "ModifiedDateRangeFilter::ToModifiedDate" ; $DateTo )

Any help out there

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Modified Date Range Filter
« Reply #1 on: July 18, 2012, 03:56:06 PM »
The elements in your example are out of sequence. Try changing them to this...

PCQB_RqNew ( "InvoiceQuery" )
PCQB_RqAddFieldWithValue ( "ModifiedDateRangeFilter::FromModifiedDate" ; $DateFrom )
PCQB_RqAddFieldWithValue ( "ModifiedDateRangeFilter::ToModifiedDate" ; $DateTo )
PCQB_RqAddFieldWithValue ( "EntityFilter::FullName" ; $CompName )

If that doesn't work (anytime something doesn't work) run the PCQB_SGetStatus function and see what it returns.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852

mikekurm@wienerminder.com

  • Member
  • *
  • Posts: 13
Re: Modified Date Range Filter
« Reply #2 on: July 18, 2012, 04:49:27 PM »
Hi Geoffrey, the error says:
CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at FromModifiedDate
Reason:   Union doesn't support this value.
The element 'FromModifiedDate' with value '0-00-00T00:00:00' failed to parse.

Field Value:   0-00-00T00:00:00

mikekurm@wienerminder.com

  • Member
  • *
  • Posts: 13
Re: Modified Date Range Filter
« Reply #3 on: July 18, 2012, 05:48:19 PM »
I tried this and it worked, (I was not looking for ToModifiedDate range..my bad, but ToTxnDate and FromTxnDate) THe following worked fine:

PCQB_RqNew ( "InvoiceQuery" )
PCQB_RqAddFieldWithValue ("TxnDateRangeFilter::FromTxnDate" ;  $DateFrom )
PCQB_RqAddFieldWithValue ("TxnDateRangeFilter::ToTxnDate" ;  $DateTo  )
PCQB_RqAddFieldWithValue ( "EntityFilter::FullName" ; $CompName )

I am going to sum all of the AppliedAmounts from each invoice to get total sales FOR any customer FOR any period.
I hope this helps others.

mikekurm@wienerminder.com

  • Member
  • *
  • Posts: 13
Invoice Query RsOpenFirstRelatedRecord (InvoiceLineRet) returns error
« Reply #4 on: July 20, 2012, 03:53:44 PM »
Is something missing or out of order.....

PCQB_RqNew ("InvoiceQuery")
PCQB_RqAddFieldWithValue ( "EntityFilter::ListID" ; $ListID )
PCQB_RsOpenFirstRelatedRecord ( "InvoiceLineRet" )


the error returned is:
CODE: -1000
SEVERITY: warning
MESSAGE: invalid record


Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: Modified Date Range Filter
« Reply #5 on: July 21, 2012, 02:12:49 PM »
Same issue under the subject "Invoice Query returning error after InvoiceLineRet"?