Skip to main content
Question

Migrating overwritten entity read-trigger

  • April 22, 2026
  • 14 replies
  • 100 views

Roger Wallin
Forum|alt.badge.img+3

Hi
Now I’m on thin ice.
I have a Uniface9 service (self-contained) that has changed an entity's read trigger, i.e. what is in the data model's read trigger is overwritten in the form.
When exporting and importing to Uniface 10.04.3_038, that what is in the entity's read trigger is still used. Is this correct?

Does it have something to do with this?
; Migration Logical: Specify whether precompiler directives are generated to prevent 
; triggers and entries from being inherited in selected cases. 
    ; 0 = do not generate 
    ; 1 = generate precompiler directives (default)
MIGRATION_SCRIPT_V9_INHERITANCE = 1

Regards RogerW

14 replies

Juliano Anoar Haoach Garcia
Forum|alt.badge.img+1

It hasn’t changed — the behavior is still the same. If you have overridden the trigger in the component, the component’s trigger will take precedence.


Juliano Anoar Haoach Garcia
Forum|alt.badge.img+1

These are the migration parameters we are using:

; Migration Logical: Specify whether precompiler directives are generated to prevent
; triggers and entries from being inherited in selected cases.
; 0 = do not generate
; 1 = generate precompiler directives (default)
MIGRATION_SCRIPT_V9_INHERITANCE = 1

; Migration Logical: Enable or disable addition of a comment at the beginning and end of each
; migrated ProcScript module with Uniface 9 trigger name.
; 0 = disable (default)
; 1 = enable
MIGRATION_SCRIPT_ADD_INFO = 0

; Migration Logical: Enable or disable addition of an 'end' statement to migrated ProcScript modules.
; 0 = disable
; 1 = enable (default)
MIGRATION_SCRIPT_ADD_END = 0

; Migration Logical: Specify whether non-functional code is migrated for components.
; 0 = non-functional code is migrated
; 1 = non-functional code is removed from normal components only
; 2 = non-functional code is removed from all components (default)
MIGRATION_SCRIPT_CLEANUP_COMPONENTS = 2

; Migration Logical: Specify whether the <$triggerAbbr> constant is defined at
; the start of migrated non-empty triggers.
; 0 = <$triggerAbbr> is never defined
; 1 = <$triggerAbbr> is always defined
; 2 = <$triggerAbbr> is defined if the keywords <$triggerAbbr> and #include are found (default)
MIGRATION_TRIGGERABBR = 1

; Migration Logical: Specify whether a constant scope block (#startdefine and #enddefine) is added
; to a migrated, non-empty trigger definition, and to each group of migrated operations.
; 0 = do not add
; 1 = add for all triggers and operation groups
; 2 = add when the trigger contains #define or #include or <$triggerAbbr> keywords (default)
MIGRATION_SCOPEDEFINE = 1

; Migration Logical: Specify whether internally-defined constant mappings that were used to bind data in
; Uniface 9 are migrated to the Declarations container of the derived component.
; 0 = migrate internally-defined constant mappings (default)
; 1 = remove internally-defined constant mappings
MIGRATION_REMOVE_MAPPING_DERIVED_COMPONENTS = 0

Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 23, 2026

Hi
I have slightly different settings, I think my settings are the default ones. In the picture below, marked with yellow.

However, to me it’s not working as before, at least for a Uniface-service, marked as Self-contained.
I see this because it’s a very old entity and there has been used a global variable in the entity read-trigger. This has been solved in Uniface9 by removing that global parameter code in this specific Uniface-service component, otherwise you get an error “Global variable not allowed in Self-contained service”, which is correct.
After the migration the component isn’t compiled in U10, because the entity read-trigger is used.

I just fear that what if this has happened the same for usual form-components. I think among several thousands of forms, we do have such forms where the default entity-triggers have been changed in the form.
I’ve to investigate this further, but any additional info appreciated.

 

 


Ingo Stiller
Forum|alt.badge.img+3
  • Participating Frequently
  • April 23, 2026

Hi Roger
We did migrate vom 9.7.04 to 10.something, no problem at all

The trigger hierarchy, including the content, remains intact, whether you're dealing with regular programs or services.

And yes, if you have services, you'll get a warning about global variables. Just ignore it—I haven't had any negative experiences so far.

Ingo


Ingo Stiller
Forum|alt.badge.img+3
  • Participating Frequently
  • April 23, 2026

Oh, there is one difference.
Since UF 10 now has only one large code container per "level" (component, subentity, field), it's no longer as easy to manipulate individual trigger contents.
For an existing program in UF 10, you need to know the trigger name and then add it somewhere within the "level" (e.g., UXGROUP vs. UCGROUP). 
If you want to know what the original content from the level above is, you won't be able to get that information at the lower level. You have to explicitly go to the level above and check there.
To reactivate the content of the upper-level trigger (in UF9, simply delete the content at the lower level), you must delete the trigger, including "trigger <name>".


Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 23, 2026

Hi
So my thinking is that, if the code in Uniface9 component read-trigger is changed compared to the one used in the default entity-read trigger, the component read-trigger should be used also in the migrated Uniface10 form.

I’ve now tested that the same is true for a form, eg. there is no component read-trigger, but the default entity read-trigger is used. To me this seem as a disaster, as the program-logic for some forms and services will be totally messed up.


Ingo Stiller
Forum|alt.badge.img+3
  • Participating Frequently
  • April 23, 2026

Hi Roger
As I said, we do no have any problem at all.
A component-level trigger "overrides" the model-level trigger. In UF 9 and UF 10 !
Have you checked the database to see what's there in UF 10?
In other words, does the component trigger appear there?
If not, then it's a migration issue.
If so, then something is wrong with the compilation.
Ingo


Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 24, 2026

Hi,
It seems that it’s only one source that has behaved like this. Other sources are ok.
In the error-source it looks like this, even though there is code in the component read-trigger in U9, so it falls back to the entity-trigger:



In  other sources it looks like this:
 

 

Very strange that this is empty in one source, and it hasn’t been noticed during the migration. The source is a bit smaller than a previous test-migration, so there is probably something missing.

Regards RogerW. 


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • April 26, 2026

You most probably have a space in the component read trigger.  This will be enough to override the default entity code.

 

for info: 

I would set this to 1 otherwise you will get 1000s of info messages, which I personally hate

MIGRATION_SCRIPT_ADD_END = 1


Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 27, 2026

Hi OsmanShariff,
I’m not sure about what you said, are you right or have you misunderstood the situation. My problem is that the upper example,where the  Occurence script is empty, should contain some code that in U9 has been edited in the component. Yes, the exported source do probably have an empty  component read-trigger. However, as the component is run, it uses the default entity code. So in that case, it’s functioning correct. I think that the “Occurence script”, should be empty, if  it hasn’t been touched in the component. As I said, it’s working correctly, in that sense, that the entity read-trigger is run, as Occurrence-script is empty. It somehow falls back to the entity default trigger, although the component occurence-trigger is empty.

I have exported the U9 source as a test in march and then the source was slightly larger than this incorrect export from last week.
Now I exported it again and it’s slightly larger than the one from march and then of course also larger than the incorrect export from last week.
To me it seems that the last week exporting has left out some small code parts from the components?? 


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • April 27, 2026

In v10, the component editor does not show what is in the entity trigger.  You need to double click to open up the entity model.

I seem to remember in v9, you see the component code and if it is empty you see the entity model code (with a different icon)

If the component does not have any code it will be blank.  The run time will still use the code in the model at entity level.


Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 27, 2026

So, now as the export-importworked ok, the above upper exemple is like this:
 

 

Someone has changed the read-trigger to get rid of the default behavior. Notice that no Delete or Write-trigger is there. Delete and Write are probably executde as in the Default entity triggers.

Here another example where the Read, Write and Delete-triggers have been modified in the component:
 

 


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • April 27, 2026

At this point I would check uxgroup in version 9 uniface for any trigger code in the component in question.

And do the same in v10, to check what is in the field ucomment

 

You can do this either using sql, or just do an xml export of the component.

 

 


Roger Wallin
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • April 27, 2026

Ok, but I used the last correct export to import into the same source-database. It’s ok now. I could of course investigate the export files, but what do I get from that. I don’t think I get some compensation from Rocket, although I can prove a deficient export 😉.