Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

Uniface 9: DSP: store of 1/many

DSP: store of 1/many

Author: osieman@gmail.com (osie_osie)

Hi All

My problem is that the foreign key of a painted entity is not inheriting the parent values which are set in the write trigger.

 

I have painted a 1/many.. autogenerated by 'copy as html'

In the presave trigger I default 0 as the value of the PK for both entities

In the write trigger of the parent I set the PK using 'sql select max(PK_NO) +1' .

 

The result is that the child entity picks up the parent value after issuing an error in the write trigger as the related field is 0 before the write command.

The only way to resolve the problem is by explicitely setting the inherited field with the parent value... which is normally a big no-no

 

Any help will be much appreciated

 

Thanks

Osie

 


 

13 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

DSP: store of 1/many

Author: osieman@gmail.com (osie_osie)

Hi All

My problem is that the foreign key of a painted entity is not inheriting the parent values which are set in the write trigger.

 

I have painted a 1/many.. autogenerated by 'copy as html'

In the presave trigger I default 0 as the value of the PK for both entities

In the write trigger of the parent I set the PK using 'sql select max(PK_NO) +1' .

 

The result is that the child entity picks up the parent value after issuing an error in the write trigger as the related field is 0 before the write command.

The only way to resolve the problem is by explicitely setting the inherited field with the parent value... which is normally a big no-no

 

Any help will be much appreciated

 

Thanks

Osie

 


 

... a nogo as long as you are under the management/control of the structure editor.

So foreign key transfer may not wotk the same way as it happened in C/S

have you set the syntax of the PK fields to len(0-0) to avoid validation problems ??

Another option may be invoking a javascript entry for the FK-transfer


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

DSP: store of 1/many

Author: osieman@gmail.com (osie_osie)

Hi All

My problem is that the foreign key of a painted entity is not inheriting the parent values which are set in the write trigger.

 

I have painted a 1/many.. autogenerated by 'copy as html'

In the presave trigger I default 0 as the value of the PK for both entities

In the write trigger of the parent I set the PK using 'sql select max(PK_NO) +1' .

 

The result is that the child entity picks up the parent value after issuing an error in the write trigger as the related field is 0 before the write command.

The only way to resolve the problem is by explicitely setting the inherited field with the parent value... which is normally a big no-no

 

Any help will be much appreciated

 

Thanks

Osie

 


 

Osie, have you tried setting the parent key in the post load occurrence trigger of the SSV?


Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:27 AM UTC

DSP: store of 1/many

Author: osieman@gmail.com (osie_osie)

Hi All

My problem is that the foreign key of a painted entity is not inheriting the parent values which are set in the write trigger.

 

I have painted a 1/many.. autogenerated by 'copy as html'

In the presave trigger I default 0 as the value of the PK for both entities

In the write trigger of the parent I set the PK using 'sql select max(PK_NO) +1' .

 

The result is that the child entity picks up the parent value after issuing an error in the write trigger as the related field is 0 before the write command.

The only way to resolve the problem is by explicitely setting the inherited field with the parent value... which is normally a big no-no

 

Any help will be much appreciated

 

Thanks

Osie

 


 

Hi osie,

I'm not an expert on web coding inside of uniface,

but I think you have to define if input/output are transferred between server and client next to "public web"

Perhaps this is not set?

Success, Uli

Hope you have no problems with the weather, we face heavy storms here in Regensburg in the afternoon


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