Currently Being Moderated

I have seen this question a couple times during my tenure here and it came up again today.

The customer was interested in finding the SI_ID of a recurring instance that he just created. When I inquired as to why he said he would like to be able to find the recurring instance and any instances that result from it.

There are a couple things that you need to know when trying to do this.

People have a misconception that a recurring instance is kind of like a parent object and that each time the instance is scheduled to run it creates "child" instances that are tied to it.  This is not the case. 

A recurring instance is just a pending instance that has the unique ability to create a new instance when it runs.  The result of this is that when you create a recurring instance the SI_ID of that recurring instance will end up being the SI_ID of the next instance it creates and NOT the SI_ID of the recurring instance through its lifetime.  This means that after each run the recurring object has a different SI_ID and nothing ties the recurring instance to the instances that resulted from it in the past.

In the BO Enterprise product as it currently sits there is no definitive way of finding which instances were created by a specific recurring instance. You can get a pretty good guess by looking at schedule times and such, but due to the potential volume of recurring instances and objects it would make it almost impossible to do easily.

I went over this with the customer (my thanks to Yuri Goron at APOS Systems!) and we discussed a way to get around this by using a custom property. This works quite well and in the following code I show how to accomplish this.



How to tie a recurring report with the resulting instances in VB.NET

When you use this method you can then query with something like

"Select si_name , si_mycustomproperty from ci_infoobjects where si_recurring = 1"

 to get the recurring instances and their custom property value.  You then query for

"Select * from ci_infoobjects where si_recurring = 0 and si_instance = 1 and si_mycustomproperty =  'the value from the previous query'"

This will return all of the instances that were created by the recurring instance.

I hope this was helpful and good luck with your projects!




Filter Blog

By author:
By date:
By tag: