rudihoremans

Webdirect insert from URL not working

Discussion created by rudihoremans on Jan 28, 2019
Latest reply on Jan 29, 2019 by rudihoremans

FMServer 16 on Mac OS High Sierra.

 

Working script in FM desktop. Insert from URL not working in WebDirect.

Wondering why this does not work. Seems a staightforward script.

Comments in light blue between < >.

 

Scriptsteps:

 

Freeze Window

Set Error Capture [ On ]

Set Variable [ $data ; Value: IMAGES::SAP_REFS_List ]

     <reference to SKU>

Set Variable [ $FileName ; Value: Substitute ( IMAGES::FileName_max_50_characters_minus psd lijn ; "BEELDEN/" ; "" ) ]

    <the filename of a PSD file in a container>

Go to Layout [ “JPG_Webdirect” (IMAGES) ; Animation: None ]

Go to Field [ IMAGES::g_JPG_container ]

Insert from URL [ Select ; With dialog: Off ; IMAGES::g_JPG_container ; "http://00.000.000.00:8888/" & $FileName ]

   <inserting the corresponding JPG from a MAMP webserver - real URL cleared to zeroes for confidentiality>

   < OK in FM desktop - does nothing in WebDirect >

Set Variable [ $dataNaam ; Value: GetContainerAttribute ( IMAGES::g_JPG_container ; "filename" ) ]

   <retrieving the name of the newly inserted file>

Set Variable [ $Path ; Value: Get(DocumentsPath) & "/" & $dataNaam ]

Export Field Contents [ IMAGES::g_JPG_container ; “$Path” ; Create directories: Off ]

   <exporting the JPG file: without problems in FileMaker desktop>

   <no export possible in WebDirect, because no file from URL inserted>

Set Field [ IMAGES::g_JPG_container ; "" ]

   <clearing the global field>

Go to Layout [ “Log user activity” (Log user activity) ; Animation: None ]

New Record/Request

Set Field [ Log user activity::Date ; Get ( CurrentHostTimestamp ) ]

Set Field [ Log user activity::User ; Get ( AccountName ) ]

Set Field [ Log user activity::Activity ; "Download JPG:" & " " & $dataNaam ]

Set Field [ Log user activity::SAP ; $data ]

Go to Layout [ original layout ; Animation: None ]

Show All Records

Outcomes