My Products
Help
ExopenPM
CONTRIBUTOR *

Filter on nested lastModifiedDateTime attribute

by ExopenPM

Hi,

 

We are fetching Inventory from the Visma.net ERP Service API with filters to only fetch changes from last time we fetch data using "lastModifiedDateTime" and "lastModifiedDateTimeCondition". This works fine but we have found that if the nested child object "warehouseDetails" changes (we are interested in 

"quantityOnHand" for instance) it has its own "lastModifiedDateTime" which updates while the root "lastModifiedDateTime" does not. Hence do we miss this update since we filter on the root object only.
 
Is it possible for us to get changes to "warehouseDetails" and other nested child objects as well via filter or do we have to always fetch all objects to be sure to get all updates?
7 REPLIES 7
ExopenPM
CONTRIBUTOR *

by ExopenPM

Hi!
Thanks for your response and the information about availabilityLastModifiedDateTime. A follow up question. Is it possible to combine the two filters with OR? I.e. both use lastModifiedDateTime > date OR availabilityLastModifiedDateTime > date in the same request yielding either base inventory objects that has been updated or inventory objects with availability updated.
Is this possible because when using them both in a request query they work with AND, that both must be fulfilled but in our case we would need an OR logic.

Marten Voort
VISMA

by Marten Voort (Updated ‎18-09-2024 14:39 by Marten Voort VISMA )

Please see comments in response to kashyap's question ðŸ˜‰

Accepted solution
Marten Voort
VISMA

by Marten Voort

Hi! All lastModifiedDateTime fields in the child objects of the Inventory endpoint relate to changes in availability. Not te be confused with actual item-warehouse details for example. Therefore you will find them directly below available fields in the endpoint response. These can also be filtered when executing a GET request. You can use  the parameters availabilityLastModifiedDateTime and availabilityLastModifiedDateTimeCondition to activate this filter. Let me know if this has the desired effect.

kashyap
PARTNER

by kashyap

How can we put both lastModifiedDateTime and availabilityLastModifiedDateTime  together in "OR" condition?

Marten Voort
VISMA

by Marten Voort

This is not possible unfortunately, you have to do two separate requests to to get this desired effect.

kashyap
PARTNER

by kashyap

The above solution does not work properly.

As mentioned earlier, availabilityLastModifiedDateTime is applied at the item-warehouse level.

While fetching records, we use the lastModifiedDateTime field from within warehouseDetails to maintain the last sync datetime on our end. This allows us to determine up to which date records have been synced with our system.

However, the values of this field are not being returned in the correct sort order. For example, we are receiving values like "2024-11-04 20:40:13", "2024-05-30 11:11:57", or "2024-01-15 20:40:13".


As a result, the same records keep appearing in the API results, leading to the processing of a large amount of redundant data on our side.



 

 

"warehouseDetails": [
      {
        "isDefault": true,
        "warehouse": "1",
        "quantityOnHand": 0,
        "available": 0,
        "availableForShipment": 0,
        "lastModifiedDateTime": "2024-11-14T01:19:20.283"
      }
    ]

 

 

kashyap
PARTNER

by kashyap

Any update on this?