DEV API – Dates Question

  • DEV API – Dates Question

    Posted by Unknown Member on April 19, 2020 at 11:01 pm
    • Steve Florko

      Member

      April 19, 2020 at 11:01 PM

      I realize this is more a user group, but hoping we have a few developers in the group.Ā 

      Has anyone used API’s to insert date into NAV/BC?Ā  I’m trying to run a sync tool and a date field continues to error.Ā  Ā It tells me thatĀ  Ā NULL, 1/1/1753 and 0D {string} is not accepted or valid.Ā  Ā Running thin on ideas on this one.

      **If i remove the field from the API fields then the process works fine.

      Any ideas?

      Thanks
      Steve

      ——————————
      Steve Florko
      IT Director
      DC International
      Carrollton TX
      ——————————

    • Adam Jacobson

      Member

      April 20, 2020 at 8:37 AM

      I have a series ofĀ postsĀ on this but it seems you have the basic.
      Here’s my tip:Ā  When trying to load data, first try to read the data and see how the OdAta/API presents the field.Ā  It’s not always obvious — especially if you are used to SQL!
      I did this forĀ  Sales Prices (page 7002) and saw that when the date is blank on the screen, it shows up in the API/ODATA as “0001-01-01”
      So, if you want no starting or ending date, I’d try that.
      Let me know – I didn’t have time to test it but this is my general approach.

      Here’s what the output looked like:
      [{“@odata.etag”:”W/”JzQ0O1c5Ni9HcUJqMjduMG5vS1NsSTUrd3VNSHJOL3o0WHJuTGpxMitqZVhpb1k9MTswMDsn””,”Item_No”:”1896-S”,”Sales_Type”:”All Customers”,”Sales_Code”:””,”Starting_Date”:”0001-01-01″,”Currency_Code”:””,”Variant_Code”:””,”Unit_of_Measure_Code”:”PCS”,”Minimum_Quantity”:0,”SalesTypeFilter”:”None”,”SalesCodeFilterCtrl”:””,”ItemNoFilterCtrl”:”1896-S”,”StartingDateFilter”:””,”CurrencyCodeFilterCtrl”:””,”FilterDescription”:” Item 1896-S”,”Unit_Price”:15,”Ending_Date”:”0001-01-01″,”Price_Includes_VAT”:false,”Allow_Line_Disc”:true,”Allow_Invoice_Disc”:true,”VAT_Bus_Posting_Gr_Price”:””}]

      Good luck
      Adam

      ——————————
      Adam Jacobson
      President
      Red Three Consulting, Inc.
      Bronx NY
      ——————————
      ——————————————-

    • Steve Florko

      Member

      April 20, 2020 at 12:20 PM

      Thank you for the response.Ā  I did figure out late last night that 1/1/1753 is the shown default in DCRM however in BC it was looking for 1/1/0001.Ā  Ā  Ā 

      Appreciate your reply.

      ——————————
      Steve Florko
      IT Director
      DC International
      Carrollton TX
      ——————————
      ——————————————-

    Unknown Member replied 5 years, 4 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘DEV API – Dates Question’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!