1 Reply Latest reply on Apr 7, 2014 5:47 AM by philmodjunk

    export search results to FM server local file



      export search results to FM server local file


           I use global fields as search input fields.

           I need to export records as search results based on this global fields . And I need to save results as CSV on server local disk (or to any local network disk). Everything works OK using FM client on local network, I needn't to perform script on server, I can save CSV directly.

           But I need to run it as FM Server 13 WebDirect.

           And here is my problem:

           If I perform search script, it can’t write CSV to server local disk.
           If I perform search script on server, the global fields can’t be used as input fields :(

           Any idea how can I solve this issue?

        • 1. Re: export search results to FM server local file

               Pass the values of the global fields to the script performed on Server as a script parameter.

               List ( Globals::Field1 ; Globals::field2 ; Globals::field3 ; // and so forth )

               can be the expression used to pass the values as a script parameter.

               GetValue ( Get ( Scriptprameter ) ; 1 )

               can be the expression to access the value of Globals::Field1

               This method assumes that some value will be passed for every field except the last field listed in the List function. (The last one can be empty.)

               If multiple fields might be empty, you can pass a text expression such as:

               "Let ( [ $FieldVal1 = " & Globals::Field1 & "; $FieldVal2 = " & Globals::Field2 & " ] ; 1 ) "

               Then Set Variable [ $Dummy ; Evaluate ( Get ( ScriptParameter )  ) ]

               will assign the value 1 to $Dummy, but also create variables $FIeldVal1 and $FieldVal2 and assign them the values of the two global fields.