Thought I had this resolved, but just discovered this not to be the case 
running Client/Server.

Apparently calling SET EXTERNAL DATA PATH and/or RELOAD EXTERNAL DATA in the 
trigger has no affect on the client. The client continues to reflect the 
version of the picture it loaded before replacing the picture in the field.

Even worse, if I quit and restart the client it continues to reflect the 
original, even if I log in as a different user. Quit and restart the server, 
however, and all is well. So, assuming this is a cache issue, in client Server 
the cache is on the server.

This is such a major bug, I think I must be doing something wrong. I created a 
small v16.1 test db to give to 4D TS. I am going to list below the steps to 
reproduce the problem in the test database in hopes that someone can point out 
the error in my way.

I sm currently at a loss as to how to force the client to forget the original 
image. 

Neither SET EXTERNAL DATA PATH or RELOAD EXTERNAL DATA can be run on the 
client. Everything has to be done on the server. The docs for RELOAD EXTERNAL 
DATA  say that on client one must reload the record "using the LOAD RECORD 
command for example”. This does not work. A record is reloaded in the normal 
process of going from the output form to the input form and moving between 
records in the output form before going to an input form. Just to be sure I 
unloaded and loaded the record manually and it made no difference. 

Keep in mind that the docs say that RELOAD EXTERNAL DATA is useful for  when a 
file in the external data storage folder is modified by a 3rd party app outside 
of 4D. It goes to imply that you only need to do that if the image is being 
displayed in a form.

Hoping someone can point out what I am doing wrong before Monday.

Thanks,

John

-------------------
1. In the output form of the table double click a record which already has a 
picture in 4D and stored outside the database in a custom external data folder. 
        Note: There is no problem creating new records. Only when the image is 
changed in an existing record.

2. In the input form load a different picture...

        $doc=Select Document(…)
        $path:=...
        READ PICTURE FILE($path;[Patient Record]Image)

        At this point I can see the newly uploaded image is being displayed in 
the field on the input form. 

3. Save the record. Trigger runs…

        $imagePath;=… full path to the file in the external data folder
        WRITE PICTURE FILE($imagePath;[Patient Record]Image)
        SET EXTERNAL DATA PATH([Patient Record]Image;$imagePath) //not really 
necessary as the path did not change but this fixed the problem in stand alone
        RELOAD EXTERNAL DATA([Patient Record]Image)  //this is the bigger 
hammer 

        At this point I can visually verify that the file in the external data 
folder has changed. So the server does in fact get the updated picture in the 
picture field.

4. Open the record again and see that the original image is still displayed not 
the one that was just saved.

        If the record is saved again now as is, the picture in the external 
data folder on the server will revert back to the original picture as step 3 
repeats with the original image.
        If you poke the image programmatically, with Picture Size for example, 
the results will be for the original picture not the update.
-----------------





 
> On Aug 3, 2017, at 1:21 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I recently changed storing a picture field outside the database from 
> automatic location to custom path name to file. Still working on getting it 
> ready for deployment.
> 
> I just noticed that if I open a form with the picture field displayed, then 
> change the picture to a different image, save it, then reopen the record, the 
> picture field continues to display the old picture. The picture file in the 
> storage folder reflects the new picture. I can actually watch it change as 
> the record is saved. The bad thing is if I save the record again the old 
> picture gets saved to the storage folder and the new picture is lost. If I 
> restart the database, without having reentered and saved again, the new 
> picture displays properly.
> 
> I know that I have to manage the creation and modification of the picture on 
> disk which I am doing, but I do not see anything that says I have to load the 
> picture from the storage folder. Am I missing something?
> 
> I also recently started working this db in v16 R4 beta so this may be a bug 
> in the beta? I do not really have an easy way to test this is an earlier 
> version of 4D.
> 
> John
> 
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> 
> 
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
> 
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> john...@hawaii.rr.com
> 
> 
> 
> 
> 

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to