Trouble with the same records exporting over and over? Chrono management to the rescue!

3 minute read time.

Have you ever exported records from X3 with the intention of getting only the records that haven’t been exported before, only to find that you end up with everything that meets the other parameters you set—including records that have already been exported?  Fear not, X3 has an option to avoid this situation, known as Chrono management.

You may be asking, “what exactly does Chrono management do?”  For the long answer, we can turn to the Field Help:

Great!  This option does exactly what you wanted, telling your export template to only pull records that have been changed since the last time this template was exported.  Let’s look at how it works.

 

If we go to Setup, Usage, Imports/Exports, Import/Export Parameters, we can check the current Sequence Number value ([C]EXPORT from the online help information above).  In this case our current value is 36.

 

For this example, I created a copy of the SOH export template (Setup, Usage, Imports/Exports, Import/Export templates), and called it ZSOH.  This record gets stored in the AOBJEXT table, with the CHRNUM field initialized to 0 (more on this in a bit).

 

I also created 3 new sales orders (Sales, Orders, Orders) and ran a quick check to see that the EXPNUM value for each one matches the current [C]EXPORT value.

 

Now we can go to Usage, Import/exports, Exports to export the sales orders.  First, we will export them with the Chrono management box left unchecked.

 

Peeking at the exported file, we can see that all three sales orders were exported (as expected), and the values for EXPNUM (SORDER table) and CHRNUM (AOBJEXT table) remain unchanged.

 

Next, go back to Sales, Order, Orders and change the quantity for the last record (SONNA0110105), then export again (still with Chrono Management unchecked).  We can see that all three sales orders were exported again, and the EXPNUM/CHRNUM values haven’t changed.

 

Now we can complete our export again, finally putting Chrono management to use.

 

Notice that our log indicates all three orders were exported again.  But we have an additional message that clues us in to Chrono management working its magic.

 

Running our SQL queries again, we can verify that the CHRNUM for the ZSOH template has changed from 0 to 36, while the EXPNUM of the orders remains the same.

 

What happens if we run the export again without changing anything?  The first thing we will notice is that Chrono management is already checked for us.  Remember when I said we would come back to the CHRNUM?  When the CHRNUM value for template is 0, Chrono management defaults to being unchecked.  If CHRNUM is any non-zero value, Chrono management will default to being checked.  Easy, right?  Now back to our regularly scheduled demo.

From the log, we see that no orders were exported, and the CHRNUM for ZSOH has been incremented to 37.

 

So, what happens if we modify one of our orders and try the export one last time?  Let’s find out!  After changing the quantity on sales order SONNA0110105 and exporting again, we get these results from the log.

 

And our SQL query:

 

Why did the EXPNUM for SONNA0110105 change to 38 when it was previously 36?  Remember that CHRNUM for ZSOH updated to 37 before we made our change? This means that the current value of [C]EXPORT at that point was incremented to 38.  Following the logic from the online help, when we modified the sales order the EXPNUM was updated with the current value of [C]EXPORT, giving us the value of 38 that we see above.  When we completed our final export, the CHRNUM for ZSOH also became 38.  From the Import/Export Parameters, we can see that our current [C]EXPORT value is now 39 (since this value increments by one after it is assigned to CHRNUM).

 

Chrono management finally gave us what we were looking for when we started, a successful export of just the orders that have been changed since the last time we exported using a specific template.  Hopefully this gives you a better understanding of how Chrono management works so it can be used to streamline future exports.

 

Until next time!