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

Bugs, Issues and Errors: $fieldname return PROCERR[<UPROCERR_FIELD>]

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

18 replies

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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

another quick-fix modification to have the changes in a single place:

"call GLOBAL_PROC" is cloned into GLOBAL_PROC1 and uses the fieldname parameter now.

the existing GLOBAL_PROC just calls the new one with $fieldname as the parameter (assuming $fieldname is correct when calling)
"call GLOBAL_PROC1($fieldname)"

Brings down the workload, but has some assumptions about calling context.


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Sounds good. You can probably do this by exporting the app to XML and using a global find and replace to set all "call GLOBAL_PROC" to "call GLOBAL_PROC("<$fieldname>")"


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Ian you are right, my code is in a global proc but call in detail field trigger.

The right solution is pass parameter with name of field to global proc and use it instead of $fieldname like Ulrich says.

 

Marco


Author: Marco (marco.aquino@dedalus.eu)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

I think that the content $fieldname is a volatile/fragile issue and (at best) is valid in non-control fields if nothing touches the active path in between.

I recommend a $$fieldname variable which is set in each field-related trigger as a quick-fix.

Better, but much more exhausting is the migration to pass the fieldname as an argument to each global proc.


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

But your statement was that this code is not in a field trigger, but in global proc called by the field trigger? Otherwise the fix to replace @$fieldname with <$fieldname> would work.


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Ok I know, but my field is "database" type and in this case (also in non-database or boilerplate) I think that the value of $fieldname, in trigger code, should be the name of field, because the focus is on the field. For control type the focus is not so.

Marco

 


Author: Marco (marco.aquino@dedalus.eu)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Hi marco,

unfortunately $fieldname is not the name of the field hosting the trigger if it is "CONTROL" type.

 


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Ian, thanks for your answer, but for me this bug fix is a problem.

I don't know how much code I need to change, we have more than 4000 components potentially affected by the problem.

Debugging I see the same behavior with U8 and U9, after setocc instruction the value of $fieldname is "PROCERR[<UPROCERR_FIELD>]", but when I back in detail trigger and I do

@$fieldname = value

U8 works, U9 crash.

I tried to return on correct entity by setocc instruction and the $fieldname now is not in error, but the value is the first field of entity and not a field where I do the action.

 

I think that in trigger field level is correct that value of $fieldname is the field itself always, I'm doing a field action (detail, leave field, etc).

 

Marco


Author: Marco (marco.aquino@dedalus.eu)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

If you are changing the occurrence, then the $fieldname value is undefined anyway. Your code is built to USE a bug in Uniface which they have since fixed. Unless you are returning to the 'current' occurrence at part of your setocc operations, you cannot and should not rely on $fieldname being what it was when you left the original occurrence.

I think we are possibly missing something in that you have not told us what the 'setocc' stuff is doing for you. And/or why it's likely to fire before the global proc.


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

$fieldname return PROCERR[<UPROCERR_FIELD>]

Author: marco.aquino@dedalus.eu (Marco)

Hi,
I found this error that in U8 did not appear.
The value of $fieldname return PROCERR[<UPROCERR_FIELD>] instead of name of field.
This appear when a setocc on other entities is performed.
Then if a new test on it like if (@ $ fieldname! = "") or assignment @$fieldname=$$VAR crashes Uniface.

Example like this

Detail trigger on a field:

call lf_proc
if (@$fieldname="")
   return -1
end if
return 0

 

the entry proc:

entry lf_proc
   setocc "ent",1
   while($status > 0)
      ...something...
   endwhile
end

The $fieldname change value  after a setocc instruction and the uniface crashes on "if" statement or at the end of trigger if I used an assignment.

 

Windows XP or Windows server 2003 R2 32bit
Uniface version 9.4.0.1 R117 or R124 also

 

Marco

 

Yes, this is the workaround but I must check every trigger because I have the common code in global proc and I used it.

Is not sufficient to save the value of $filedname in a local variable, because I don't know if every trigger that use a global proc has or not code before that causes a $fieldname error. The right way is to pass a global proc a saved value for use it, so I need to change definition of global proc, or use, and then defined in every component, a component variabile to save and use the right value of $fieldname.

I remind that in the previous version U8 worked fine, it is conceivable a solution by Compuware?

Marco


Author: Marco (marco.aquino@dedalus.eu)