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?
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
Should be $ioprint instead of $traceprint
Yes and no 🙂I want to see, which code is executed. Which one fires the retrieve/read-trigger?But $ioprint=1023 could also be a hintIngo
below is log file content that shows read trigger called due to clear, please suggest!
"Status:0, DBError:0" (_detail); DTLF; 2; ; $traceprint = 1023
"Status:0, DBError:0" (_detail); DTLF; 3; ; setocc "ENTY1", $curocc(ENTY1.CSPRD) + 1
"Status:0, DBError:0" (_read); READ; 1; ; if ($curocc(ENTY2.CSPRD) > $NUMBER_EMPTY$ + $NUMBER_EXTRA$)
"Status:0, DBError:0" (_read); READ; 2; ; if ($curocc(ENTY2.CSPRD) = $NUMBER_EMPTY$ + $NUMBER_EXTRA$ + 1)
"Status:0, DBError:0" (_read); READ; 3; ; $LAST_PARENT$ = 0
"Status:0, DBError:0" (_read); READ; 4; ; endif
"Status:0, DBError:0" (_read); READ; 5; ; read u_where(((_ID.ENTY1 = _ID.ENTY2) & (_PARENT.PRD
"Status:0, DBError:0" (_read); READ; 6; ; if ($status = 0)
"Status:0, DBError:0" (_read); READ; 7; ; $LAST_PARENT$ = _CHILD.ENTY1
"Status:0, DBError:0" (_read); READ; 8; ; endif
"Status:0, DBError:0" (_read); READ; 9; ; endif
"Status:0, DBError:0" (_read); READ; 10; ; done
Hi Imrana) Are ENT1 or ENT2 are painted inside the other?b) Is there a relationship between ENT1 and ENT2?Ingo
a) yes, ENT1 is painted inside ENT2.
b) In read trigger of ENT1 filter criteria applied using _ID from ENT2
(_ID.ENTY1 = _ID.ENTY2)
Hi ImranOkay, you "define" a relation between this two entities by U_WHEREBut in the model,a) are the keys proper definedb) is there a relation (in model, not in the component)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.
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:
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 ...
I suspect you have defined an "Initial value" for those fields "automagically" used as filters.
Try to check your sources about it...
As I am new to uniface not sure where do I check initial value of what? Others in my team also are not sure about this behavior.
please let me know if you want me to check any specific property/attribute.
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.
happy to have help you somehow... 🙂
Anyhow if you want to have a look to more info on "Initial Value" field property could be found here.
77 4th AvenueWaltham, MA 02451 USA
Rocket Support Community
All Support Offerings
About Rocket Software
Training and Services
Forum Terms and Conditions
Contact Forum Moderator