Author Topic: BirthDate Error Code:-1000 Failed validation  (Read 2295 times)

Ritesh Gupta

  • Member
  • *
  • Posts: 13
BirthDate Error Code:-1000 Failed validation
« on: October 10, 2013, 06:36:37 AM »
Hi All

I am using this
PCQB_RqAddFieldWithValue( "BirthDate" ;  If ( IsEmpty ( Personnel Records::Date of Birth ); ""; PCQB_SFormatString ( Personnel Records::Date of Birth ; "DATETYPE" )) ).


Getting Error:
CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at HiredDate
Reason:   Union doesn't support this value.
The element 'HiredDate' with value '2002-2020-2011' failed to parse.

Field Value:   2002-2020-2011

<?xml version="1.0" ?><!DOCTYPE QBXML PUBLIC '-//INTUIT//DTD QBXML QBO 6.0//EN' 'http://webapps.quickbooks.com/dtds/qbxmlops60.dtd'><QBXML><QBXMLMsgsRq onError="stopOnError"><EmployeeAddRq><EmployeeAdd><Name>Tyler Perry</Name><FirstName>Tyler</FirstName><LastName>Perry</LastName><SSN></SSN><Email></Email><HiredDate>2002-2020-2011</HiredDate><Phone>334-669-4381</Phone></EmployeeAdd></EmployeeAddRq></QBXMLMsgsRq></QBXML>

What I am doing wrong here...I am new in FM and FMBook Connector..Please help me
Thanks
Ritesh

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: BirthDate Error Code:-1000 Failed validation
« Reply #1 on: October 10, 2013, 08:54:13 AM »
The value in HiredDate doesn't conform to the QB format. it should be YYYY-MM-DD.

HTH!

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

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: BirthDate Error Code:-1000 Failed validation
« Reply #2 on: October 10, 2013, 09:00:54 AM »
Just saw your posting in another thread on the same subject. Quoting from my reply:

This may be an issue where the plug-in is not parsing the elements of a date value correctly for non-US formatted dates. You should be able to create an acceptable value by calculation:

Let ( x = TO::YourDate ; Year ( x ) & "-" & Right ( "0" & Month ( x ) ; 2 ) & "-" & Right ( "0" & Day ( x ) ; 2 ) )

which should evaluate to a date formatted as YYY-MM-DD.

HTH!

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

Ritesh Gupta

  • Member
  • *
  • Posts: 13
Re: BirthDate Error Code:-1000 Failed validation
« Reply #3 on: October 14, 2013, 05:12:34 AM »
I have used this
Let ( x = TO::YourDate ; Year ( x ) & "-" & Right ( "0" & Month ( x ) ; 2 ) & "-" & Right ( "0" & Day ( x ) ; 2 ) )

and also tried (created calculation field as yyyy-mm-dd) but I didn't success.

also changed date format in filemaker .
please suggest me what I will do...!!!!

Thanks

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: BirthDate Error Code:-1000 Failed validation
« Reply #4 on: October 14, 2013, 09:01:20 AM »
What is the error message you're getting with the revised input?

It might also be instructive to see what your Request looks like. After you've run your Employee Add Request, go to your data viewer and evaluate this expression:

PCQB_SGetXML( "Request" ; "" )

and post the result here.


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

Ritesh Gupta

  • Member
  • *
  • Posts: 13
Re: BirthDate Error Code:-1000 Failed validation
« Reply #5 on: October 14, 2013, 10:39:03 PM »
Error message:-
CODE: -1000
SEVERITY: failed validation
MESSAGE: Error at HiredDate
Reason:   Union doesn't support this value.
The element 'HiredDate' with value '2019-2011-03' failed to parse.

Field Value:   2019-2011-03

XML request:
<?xml version="1.0" ?><!DOCTYPE QBXML PUBLIC '-//INTUIT//DTD QBXML QBO 6.0//EN' 'http://webapps.quickbooks.com/dtds/qbxmlops60.dtd'><QBXML><QBXMLMsgsRq onError="stopOnError"><EmployeeAddRq><EmployeeAdd><IsActive>0</IsActive><FirstName>Scott</FirstName><LastName>Brown</LastName><EmployeeAddress><Addr1></Addr1><Addr2></Addr2><City></City><State></State><PostalCode></PostalCode></EmployeeAddress><Phone></Phone><SSN></SSN><Email></Email><HiredDate>2019-2011-03</HiredDate></EmployeeAdd></EmployeeAddRq></QBXMLMsgsRq></QBXML>

See Data Viewer snap:

Ritesh Gupta

  • Member
  • *
  • Posts: 13
Re: BirthDate Error Code:-1000 Failed validation
« Reply #6 on: October 14, 2013, 10:43:01 PM »
Sorry I forgot to attached script..
please here you can see the script.

Also checked with PCQB_SFormatString ( $Date ; "DATETYPE" )
« Last Edit: October 14, 2013, 10:47:24 PM by Ritesh Gupta »

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: BirthDate Error Code:-1000 Failed validation
« Reply #7 on: October 15, 2013, 08:05:27 AM »
I can't make sense of the result you report. Your script shows you setting $date to a correctly formatted value, and then passing the value of $date as the HiredDate element's value. Your XML request, however, is showing a different value. Are you sure your showing the correct error message?

If you're running FileMaker Advanced, use the Script Debugger and add a break point at the PCQB_Execute step. Before executing that step, evaluate PCQB_SGetXML( "Request" ; "" ) and post the result here. I'd like to see if the value HireDate at that point matches the value of $date. What you've posted indicates it doesn't, but that makes no sense.

HTH!

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