If you're trying to use a Feeder Logic to emit items to a dataloader, you'll notice that the "Incremental" tickbox has no effect by default.

Setting this tickbox does however set some properties, which can then be used for emitting items which are more recently updated than the incremental date.


For an example on how to use incremental with a datafeeder, see below code snippet, which will emit all PricelistItems, sorted by most recent update date, from pricelist ID 999:


feedObjects("PLI", Filter.equal("pricelistId", 999), "-lastUpdateDate")

void feedObjects(String typeCode, Filter filter = null, String sortBy = null, Boolean supportIncremental = true) {
  List<Number> ids = getObjectIds(typeCode, filter, sortBy, supportIncremental)
  for (id in ids) {
    api.emitPersistedObject(typeCode, id)
  }
}

List<Number> getObjectIds(String typeCode, Filter filter = null, String sortBy = null, Boolean supportIncremental = true){
  if(supportIncremental)
    filter = getIncrementalFilter(filter)

  def stream = api.stream(typeCode, sortBy ?: "-lastUpdateDate", ["id"], filter)
  List<Number> ids = stream?.collect { it.id }
  stream?.close()
  return ids
}

Filter getIncrementalFilter(Filter filter = null){
  if (api.currentItem("incremental") as Boolean) {
    Filter timeFilter = Filter.greaterOrEqual("lastUpdateDate", api.currentItem("incCalculationDate") ?: api.currentItem("incLoadDate"))

    if (filter)
      filter = Filter.and(filter, timeFilter)
    else
      filter = timeFilter
  }
  return filter
}