Forum Discussion

DeepaPrashant1's avatar
DeepaPrashant1
Qrew Cadet
9 months ago

API_edit record not updating records if there is no change

Hello,

I have two tables that use API_edit to update records. One of them works like a charm and I can see that the table has been updated daily irrespective of a change in data. This table that works well has fields which are all populated with data. That is every field has a data element.

The other table that runs without error as shown below:

<?xml version="1.0" ?>
<qdbapi>
    <action>API_EditRecord</action>
    <errcode>0</errcode>
    <errtext>No error</errtext>
    <rid>459</rid>
    <num_fields_changed>0</num_fields_changed>
    <update_id>1699466034771</update_id>
</qdbapi>

does not update the table. Zero fields were changed. This table has fields that may or may not hold data for that record. There is no other difference that I have been able to discern between the two tables. I would like to see this table also show an update date even if there is no change.

Does anyone know what may be causing this?

Thanks

Deepa



------------------------------
Deepa Prashant
------------------------------

4 Replies

  • Do you have a field or data value in the first table that has some kind of timestamp associated with the table load? If you just want to see that something ran/changed - you can add a date/time field to table (2) and when you make your edit record call, include the value of 'Now' into that date/time field to enforce that at least one data point is changing with each daily run. 



    ------------------------------
    Chayce Duncan
    ------------------------------
    • DeepaPrashant1's avatar
      DeepaPrashant1
      Qrew Cadet

      Hi Chayce,

      No I do not have a field in the first table (the one that works as expected) that has a date/timestamp in it. That's what is puzzling me.

      Here are the results from this table: every record has exactly 5 fields and each has data.

       <?xml version="1.0" ?>
      <qdbapi>
          <action>API_EditRecord</action>
          <errcode>0</errcode>
          <errtext>No error</errtext>
          <rid>77</rid>
          <num_fields_changed>5</num_fields_changed>
          <update_id>1699987690347</update_id>
      </qdbapi>

      Whereas, the second table has address fields, and not all fields have data and hence some may have 8 fields to update whereas another may have 4 fields to update. I am not pulling in blank fields.

      Tried pulling in blank fields and that too did not work. :-(



      ------------------------------
      Deepa Prashant
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        In your first table - are you loading numeric fields by chance? It's possible that you're loading numbers as 10.0 where you're sending decimals and QB is treating the .0 as a change despite only saving 10 into the actual database. 

        In either case - if you're problem here is that you want the second table to sync up / show as having changed each day with the editRecord - I would suggest adding a date/time field and logging the value of now. Nothing in your data set seems to be picked up as having changed on a day over day basis, so if you want the record to show as modified, include a date/time field and in your edit record call include the value of 'now' each day so that you know it was processed. 



        ------------------------------
        Chayce Duncan
        ------------------------------