Max Occurrences/Records in component

Author: i.sharp@pcisystems.co.uk (Iain Sharp)

When defining an entity the developer can set the minimum and maximum Number of Occurences (defined as Maximum/Minimum Records in the documentation). This can then be overridden at component level. Is there any way of finding out the current value of this for a component, so behaviour can be coded into the model in, for example, the $collectionhandle("ENTITY")->add() I'd like to do this without having to add a component level define, using something like $entinfo or $entityproperties. Iain

3 Comments

  1. Hi Iain, have a look at http://unifaceinfo.com/forum/ditodoitourself/larry-adkins-wish-entinfoentnamefieldlist/ this is a sketch how to prepare information from the repository (like your max occurences) to be used at runtime. Either as straight #defines or (to provide long texts like comment info) as a procedure similar to $entinfo. I prefer to deliver this information as Include Procs, so they do not change the Last Update Stamp.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. I'm obviously missing something, Where would I put this in the model such that when a new U.I. is created from the modelled fields, and the component version of the property is overridden in the Entity definition of the component, it automatically added a component specific include proc with the correct information in it? I presume the procs are included in an export for dITo somewhere? Do they integrate into the IDF? The developer has, correctly, limited the occurrences of one of the entities to a single occurrence in the component, however some code in the model for that entity creates a second occurrence under certain circumstances. So the code needs to be changed to error to the user not to use that type of data in this program, because it doesn't make sense. If the user has to know to run something to 'automatically' add a one line #define statement, it's not automatic.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  3. Hi Iain, the pseudocode in my sketch accesses the modeled info ("UC*") change it to "UX*" and you have the component-relevant infos As we all know, the IDF does not provide extension points where we can hook these type of additional processing, so we have to create an additional menu entry to compile the form, create the Included Proc with the name of the comnponent and recompile the form again. But you may like to wait for an official implementation making this 'automatically'.


    Author: ulrich-merkel (ulrichmerkel@web.de)