[SOLVED] Retrieve/x and $fromdbmod

Author: lorenzen@ahp-gmbh.de (lorenzen)

 Hello there, i use retrieve/x to get specific Occurrences from DB. In the read-Trigger i set some None DB Field values. Retrieving the first Occurrence $formdbmod is 0, even $occdbmod. Retrieving next Occurence $formdbmod is 1 and $occdbmod is 0. Documentation says to $formdbmod = 1 :

Field has been modified; this can be due to:    • A database field in a database entity has been modified    • An database occurrence has been added to or removed from the component 
 
forlist lv_pkey in lv_pkeys_list   lv_pk = $concat($itemnr(1, lv_pkey), ".", lv_entity)   if (@lv_pk != "") creocc lv_entity, -1   getlistitems/occ lv_pkey, lv_entity   retrieve/x lv_entity   if ($status < 1) remoc lv_entity endfor
 

If i set /init switch , $formdbmod is 0, but documentation to /init says:

This switch has no effect once a retrieve has been completed.

I'am a little bit confused. Lars

2 Comments

  1. Hello Lars, It seems that $formdbmod is set by the getlistitems/occ statement. Since you are using the mentioned statement to set a retrieve profile it's probably better to use getlistitems/occ/init. This should solve the described problem with $formdbmod (and using the /init for the non-db field in the Read trigger). Also, it seems that the statement about the /init switch ("This switch has no effect once a retrieve has been completed") is only applicable for database fields. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  2. Thank you Daniel, setting retrieveprofile with "getlistitems/occ/init" works fine. Topic can be closed. Lars


    Author: lorenzen (lorenzen@ahp-gmbh.de)