Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

TemDB lookup

$
0
0

I am aware of a (the?) way to do this. There are many examples on the web and I am more than capable of writing a lookup for a form control.

However, this specific lookup is used a lot. My boss likes the idea of a year lookup. So in basically every new add-in I create, I need to build this lookup.

My attempt to create a easily-reusable-implementation looks like the following:

1. XYZYear is an EDT Integer with Form Help set to XYZYearLookup

2. XYZYearLookup is a Lookup Form with XYZYearTmp as datasource

3. XYZYearTmp is a TempDB Table with exactly one field XYZYear

The idea is that this will enable me to simply drag in XYZYear on tables/forms. The lookup is already written and I can continue without bothering about year lookups.

It works....almost. The lookup is fine. But after a year is clicked, the form control does not show anything. I guess it is because the table buffer went out of scope, thus the selected record no longer exists. So I am wondering whether this solution can work? If it can; how do I keep the TempDB buffer in scope? (The lookup method on a FormIntegerControl does not return anything.)

If there is uncertainty about the code implementation:

class XYZYearLookup extends FormRun
{

   XYZYearTmp yearTmpLocal;

   void init()
   {
      super();
      yearTmpLocal = XYZYearTmp::constructRangedDefault(); //insert some years
      XYZYearTmp.linkPhysicalTableInstance(yearTmpLocal);
   }
}


And it actually does not make sense to me that the TempDB buffer is the issue. I'm not sure exactly how these lookups work, but all that it needs to return is the integer? The buffer/record is not relevant. In other words the integer value can (should) exist in the FormIntegerControl without the existence of the lookup form's buffer.

Thanks for reading


Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>