cancel
Showing results for 
Search instead for 
Did you mean: 

how to debug a JSON_PARSER_ERROR on an upsert

johnw
Executive Chef I
Executive Chef I

 

it seems like a simple upsert into the OrderItem or products object in sfdc but get the error message that doesn;t really give me a clue as to what might be wrong

 

        • 28          Status code: JSON_PARSER_ERROR,
        • 29          Message: Cannot deserialize instance of date from VALUE_STRING value or request may be missing a required field at [Source: N/A; line: -1, column: -1][line:-1, column:-1],

 

here is the full log

  Failed records: [

  • 4     {
    • 5      attributes: {
      • 6        type: OrderItem

      7},

    • 8      ERP Sales Order Line Num: 111816-1,
    • 9      Price Book Entry ID: <18 digit ID>,
    • 10      Product ID: <18 digit ID>,,
    • 11      Unit Price: 99.99,
    • 12      Ship Qty: 0,
    • 13      Sched Ship Date: ,
    • 14      Ship Date: ,
    • 15      LineRel: 11,
    • 16      Cust Req Date: 2024-08-14,
    • 17      Backlog Qty: 60,
    • 18      Quoted List Price: 99.99,
    • 19      Ordered Quantity: 60,
    • 20      ShipDtlQty: ,
    • 21      Quoted Quantity: 60,
    • 22      Original Promised Date: ,
    • 23      Quantity: 60,
    • 24      Order ID: <18 digit ID>,,
    • 25      Success: false,
    • 26      Errors: [
      • 27         {
        • 28          Status code: JSON_PARSER_ERROR,
        • 29          Message: Cannot deserialize instance of date from VALUE_STRING value or request may be missing a required field at [Source: N/A; line: -1, column: -1][line:-1, column:-1],
1 ACCEPTED SOLUTION

johnw
Executive Chef I
Executive Chef I

Thanks… I was going down that path till I learned that unlike opportunity products where you add the ProductID

For Order Products you HAVE to add the PricebookEntryID so once I did that I’m golden…. Now I just need to make sure there aren’t orders with more than 1 pricebook

John

View solution in original post

3 REPLIES 3

shivakumara
Executive Chef I
Executive Chef I

Hi @johnw ,

After observing the request I could see "value for the date column is missing" either SFDC is expecting values for those column(s).

Can you re-try after providing values for that? 

Thanks and Regards,
Shivakumara Avadhani

gary1
Executive Chef III
Executive Chef III

Adding to Shivakumara, I think you are passing blank values where dates (or valid values) are expected:

  • 13      Sched Ship Date: ,
  • 14      Ship Date: ,
  • ...
  • 22      Original Promised Date: ,

There's also this field (not a date, but also appears to be missing a value and could be causing an issue):

  • 20      ShipDtlQty: ,

I'm assuming these all must either be null or have a value. Start troubleshooting there.

johnw
Executive Chef I
Executive Chef I

Thanks… I was going down that path till I learned that unlike opportunity products where you add the ProductID

For Order Products you HAVE to add the PricebookEntryID so once I did that I’m golden…. Now I just need to make sure there aren’t orders with more than 1 pricebook

John