When setting up a recurring data job, we have a functionality called Prevent upload when zero records. This will skip the data upload when the record count is 0. But setting up a recurring data job needs a separate application in azure.
In a different way, we can also run or call a data entity directly from code i.e., X++. Once we get the fileId, the filestream can be retrieved. Using the stream we can either upload it to azure container or any other API.
Now in the above scenario, can we call the functionality "Prevent upload when zero records"?
As of now we do not have such option from base. But in a different work around, we can achieve using custom logic.
Below is the logic for the same.
Here
I am checking the no of records by passing the Definition Group, entity name and the execution Id.
What does this means?
When an entity export job execution happens, on a successful export, we get the no of records that are exported. This can be used in the above way as well.
A simple call to the said method which gives us the count and if the count is greater than zero, we can understand, the file has some records.
In this way, only files with records will be shared or uploaded to azure container.
​​​​​​​
Happy Learning !