Hi Experts,
Thanks for help in advance!
I have a button on screen which when clicked will clear/e and retrieve/e data for an entity filter applied using inputs from master entity. The problem is in some cases data is not fetched when debug found that when clear/e statement is executed read trigger fires and populates data and next when retrieve/e statement is executing error (ERROR:2, MNEM: <UIOSERR_OCC_NOT_FOUND>, DESCRIPTION: Occurrence not found) is thrown and finally no data is fetched.
can anyone please help understand what could be cause of issue and is it possible that read trigger fire when clear/e is executed?
Thanks,
Imran.
Hi Imran
start the detail-trigger of the button with
$proc_tracing = 1
$traceprint = 1023
Now you should see in the LOG-file which statement really fires a (unwanted) retrieve 🙂
don't forget to set
$proc_tracing = 0
$traceprint = 0
at the end of the detail-trigger, else you got MB of text in LOG-File
Ingo
Hi Imran
start the detail-trigger of the button with
$proc_tracing = 1
$traceprint = 1023
Now you should see in the LOG-file which statement really fires a (unwanted) retrieve 🙂
don't forget to set
$proc_tracing = 0
$traceprint = 0
at the end of the detail-trigger, else you got MB of text in LOG-File
Ingo
Hi Ingo,
below is log file content that shows read trigger called due to clear, please suggest!
"Status:0, DBError:0" (_detail); DTLF; 2; [0]; $traceprint = 1023
"Status:0, DBError:0" (_detail); DTLF; 3; [0]; setocc "ENTY1", $curocc(ENTY1.CSPRD) + 1
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 3; [0]; $LAST_PARENT$ = 0
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; [0]; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:2, DBError:0" (_detail); DTLF; 4; [0]; if ($status < 0)
"Status:2, DBError:0" (_detail); DTLF; 6; [0]; endif
"Status:2, DBError:0" (_detail); DTLF; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:2, DBError:0" (_detail); DTLF; 8; [0]; call LOAD_LOWERS()
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 1; [0]; if ($curocc(ENTY2.CSPRD) < $hits(ENTY2.CSPRD) + $NUMBER_EMPTY$ + $NUMBER_E
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 2; [0]; $1 = $curocc(ENTY2.CSPRD) + 1
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 3; [0]; repeat
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 4; [0]; setocc "ENTY2", $1
"Status:6, DBError:0" (_detail); LOAD_LOWERS; 5; [0]; clear/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; [0]; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 6; [0]; retrieve/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:-2, DBError:0" (_read); READ; 6; [-2]; if ($status = 0)
"Status:-2, DBError:0" (_read); READ; 8; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 9; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 10; [-2]; done
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 7; [-2]; $1 = $1 + 1
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 8; [-2]; until ($1 > $hits(ENTY2.CSPRD) + $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 3; [-2]; repeat
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 4; [-2]; setocc "ENTY2", $1
"Status:7, DBError:0" (_detail); LOAD_LOWERS; 5; [0]; clear/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; [0]; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 6; [0]; retrieve/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:-2, DBError:0" (_read); READ; 6; [-2]; if ($status = 0)
"Status:-2, DBError:0" (_read); READ; 8; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 9; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 10; [-2]; done
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 7; [-2]; $1 = $1 + 1
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 8; [-2]; until ($1 > $hits(ENTY2.CSPRD) + $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 3; [-2]; repeat
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 4; [-2]; setocc "ENTY2", $1
"Status:8, DBError:0" (_detail); LOAD_LOWERS; 5; [0]; clear/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; [0]; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 6; [0]; retrieve/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:-2, DBError:0" (_read); READ; 6; [-2]; if ($status = 0)
"Status:-2, DBError:0" (_read); READ; 8; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 9; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 10; [-2]; done
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 7; [-2]; $1 = $1 + 1
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 8; [-2]; until ($1 > $hits(ENTY2.CSPRD) + $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 3; [-2]; repeat
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 4; [-2]; setocc "ENTY2", $1
"Status:9, DBError:0" (_detail); LOAD_LOWERS; 5; [0]; clear/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; [0]; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; [0]; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:0, DBError:0" (_detail); LOAD_LOWERS; 6; [0]; retrieve/e "ENTY1"
"Status:0, DBError:0" (_read); READ; 1; [0]; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; [0]; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 4; [0]; endif
"Status:0, DBError:0" (_read); READ; 5; [0]; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:-2, DBError:0" (_read); READ; 6; [-2]; if ($status = 0)
"Status:-2, DBError:0" (_read); READ; 8; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 9; [-2]; endif
"Status:-2, DBError:0" (_read); READ; 10; [-2]; done
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 7; [-2]; $1 = $1 + 1
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 8; [-2]; until ($1 > $hits(ENTY2.CSPRD) + $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 9; [-2]; endif
"Status:-2, DBError:0" (_detail); LOAD_LOWERS; 10; [-2]; done
"Status:-2, DBError:0" (_detail); DTLF; 9; [0]; setocc "ENTY2", $OCC_LAST$
"Status:5, DBError:0" (_detail); DTLF; 10; [0]; call LOAD_ENTY3()
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 1; [0]; if ($curocc(ENTY2.CSPRD) = $OCC_LAST$)
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 2; [0]; fieldsyntax "start_number", " "
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 3; [0]; fieldvideo "start_number", "DEF"
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 4; [0]; START_NUMBER.DUMMY = 0
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 5; [0]; $READ_KEY$ = "mste1"
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 6; [0]; $PARENT_NUMBER$ = _CHILD.ENTY1
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 7; [0]; clear/e "ENTY3"
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 8; [0]; retrieve/e "ENTY3"
"Status:0, DBError:0" (_read); READ; 1; [0]; if (START_NUMBER.DUMMY > 0 & START_NAME.DUMMY = '')
"Status:0, DBError:0" (_read); READ; 3; [0]; else
"Status:0, DBError:0" (_read); READ; 4; [0]; if (START_NAME.DUMMY != '')
"Status:0, DBError:0" (_read); READ; 6; [0]; else
"Status:0, DBError:0" (_read); READ; 7; [0]; read u_where((_PARENT.ENTY3 = $PARENT_NUMBER$)) order by "_fu
"Status:0, DBError:0" (_read); READ; 8; [0]; endif
"Status:0, DBError:0" (_read); READ; 9; [0]; endif
"Status:0, DBError:0" (_read); READ; 10; [0]; done
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 9; [0]; if ($hits(ENTY3.CSPRD) = 0)
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 11; [0]; endif
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 12; [0]; if (_CHILD.ENTY3 > 1)
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 13; [0]; $prompt = _FULL.ENTY3
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 16; [0]; endif
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 17; [0]; endif
"Status:0, DBError:0" (_detail); LOAD_ENTY3; 18; [0]; done
"Status:0, DBError:0" (_detail); DTLF; 11; [0]; $proc_tracing = 0
]] >
thanks
Hi Imran
start the detail-trigger of the button with
$proc_tracing = 1
$traceprint = 1023
Now you should see in the LOG-file which statement really fires a (unwanted) retrieve 🙂
don't forget to set
$proc_tracing = 0
$traceprint = 0
at the end of the detail-trigger, else you got MB of text in LOG-File
Ingo
a) Yes keys are defined in model for both the entities.
b) There is no relation defined in model between both the entities ENT1 and ENT2.
but there are four relationships defined in model for ENT2 for other entities and one of them(ENT4) is also painted inside ENT2.
Hope this answers, please let me know if need more information.
thanks!
Hi Imran
start the detail-trigger of the button with
$proc_tracing = 1
$traceprint = 1023
Now you should see in the LOG-file which statement really fires a (unwanted) retrieve 🙂
don't forget to set
$proc_tracing = 0
$traceprint = 0
at the end of the detail-trigger, else you got MB of text in LOG-File
Ingo
Hi Imran,
I honestly find your code what we call ...ehm ...spaghetti mode... (sorry for being brutally honest here!) ...but anyhow IMHO:
if ENT1 is picted inside ENT2 probably the read trigger of ENT1 is NOT activated from clear/e but from the previous instruction (module LOAD LOWERS line 4):
setocc "ENTY2", $1
because when you change current occ of an external entity Uniface initially reposition itself on it and only later it starts reading about consequences of the repositioning.
To verify this hypothesis try to add a reference to ENTY1:
putmess _ID.ENTY1
into line 5 of module LOAD_LOWERS just after that setocc line and probably you will see read trigger of ENTY1 starting before your clear/e.
Just 2 cents here ...
Gianni
Hi Experts,
Thanks for help in advance!
I have a button on screen which when clicked will clear/e and retrieve/e data for an entity filter applied using inputs from master entity. The problem is in some cases data is not fetched when debug found that when clear/e statement is executed read trigger fires and populates data and next when retrieve/e statement is executing error (ERROR:2, MNEM: <UIOSERR_OCC_NOT_FOUND>, DESCRIPTION: Occurrence not found) is thrown and finally no data is fetched.
can anyone please help understand what could be cause of issue and is it possible that read trigger fire when clear/e is executed?
Thanks,
Imran.
Hi Gianni,
yeah 🙂 you may be right, this is a legacy application so . . .
I was unable to understand the behavior but as work around created form variable which is set on/off before and after clear/e statement and used it in read trigger to conditionally execute code hence avoiding code execution when read fires due to clear/e. This has solved the issue.